ShilongLiu commited on
Commit
f45dd9b
1 Parent(s): 66fc935

update app

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -7,6 +7,7 @@ os.system("python -m pip install -e GroundingDINO")
7
  os.system("pip install --upgrade diffusers[torch]")
8
  os.system("pip install opencv-python pycocotools matplotlib onnxruntime onnx ipykernel")
9
  os.system("wget https://github.com/IDEA-Research/Grounded-Segment-Anything/raw/main/assets/demo1.jpg")
 
10
  os.system("wget https://huggingface.co/spaces/mrtlive/segment-anything-model/resolve/main/sam_vit_h_4b8939.pth")
11
  sys.path.append(os.path.join(os.getcwd(), "GroundingDINO"))
12
  sys.path.append(os.path.join(os.getcwd(), "segment_anything"))
@@ -305,9 +306,9 @@ if __name__ == "__main__":
305
  input_image = gr.Image(
306
  source='upload', type="pil", value="demo1.jpg")
307
  task_type = gr.Dropdown(
308
- ["det", "seg", "inpainting", "automatic"], value="automatic", label="task_type")
309
- text_prompt = gr.Textbox(label="Text Prompt", placeholder="dog . cat . bench .")
310
- inpaint_prompt = gr.Textbox(label="Inpaint Prompt", placeholder="a sofa in a living room .")
311
  run_button = gr.Button(label="Run")
312
  with gr.Accordion("Advanced options", open=False):
313
  box_threshold = gr.Slider(
 
7
  os.system("pip install --upgrade diffusers[torch]")
8
  os.system("pip install opencv-python pycocotools matplotlib onnxruntime onnx ipykernel")
9
  os.system("wget https://github.com/IDEA-Research/Grounded-Segment-Anything/raw/main/assets/demo1.jpg")
10
+ os.system("wget https://huggingface.co/ShilongLiu/GroundingDINO/resolve/main/groundingdino_swint_ogc.pth")
11
  os.system("wget https://huggingface.co/spaces/mrtlive/segment-anything-model/resolve/main/sam_vit_h_4b8939.pth")
12
  sys.path.append(os.path.join(os.getcwd(), "GroundingDINO"))
13
  sys.path.append(os.path.join(os.getcwd(), "segment_anything"))
 
306
  input_image = gr.Image(
307
  source='upload', type="pil", value="demo1.jpg")
308
  task_type = gr.Dropdown(
309
+ ["det", "seg", "inpainting", "automatic"], value="seg", label="task_type")
310
+ text_prompt = gr.Textbox(label="Text Prompt", placeholder="bear . beach .")
311
+ inpaint_prompt = gr.Textbox(label="Inpaint Prompt", placeholder="A dinosaur, detailed, 4K.")
312
  run_button = gr.Button(label="Run")
313
  with gr.Accordion("Advanced options", open=False):
314
  box_threshold = gr.Slider(