Reverted app.py to the one from commit 0163de186a539bd69c6a45927face2578c0ff568
Browse files
app.py
CHANGED
@@ -35,13 +35,13 @@ subprocess.run(
|
|
35 |
)
|
36 |
)
|
37 |
from gradio_image_prompter import ImagePrompter
|
38 |
-
|
39 |
subprocess.run(
|
40 |
shlex.split(
|
41 |
"pip install MultiScaleDeformableAttention-1.0-cp310-cp310-linux_x86_64.whl"
|
42 |
)
|
43 |
)
|
44 |
-
|
45 |
"""
|
46 |
subprocess.run(
|
47 |
shlex.split(
|
@@ -53,9 +53,9 @@ subprocess.run(
|
|
53 |
# script = file.read()
|
54 |
#call(script, shell=True)
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
|
60 |
def find_cuda():
|
61 |
# Check if CUDA_HOME or CUDA_PATH environment variables are set
|
@@ -89,7 +89,6 @@ CONF_THRESH = 0.23
|
|
89 |
def get_args_parser():
|
90 |
"""
|
91 |
Example eval command:
|
92 |
-
|
93 |
>> python main.py --output_dir ./gdino_test -c config/cfg_fsc147_vit_b_test.py --eval --datasets config/datasets_fsc147.json --pretrain_model_path ../checkpoints_and_logs/gdino_train/checkpoint_best_regular.pth --options text_encoder_type=checkpoints/bert-base-uncased --sam_tt_norm --crop
|
94 |
"""
|
95 |
parser = argparse.ArgumentParser("Set transformer detector", add_help=False)
|
@@ -433,13 +432,11 @@ exemplar_img_drawing_instructions_part_2 = '<p>The boxes you draw are called \"v
|
|
433 |
instructions_main = """
|
434 |
# How to Use the App
|
435 |
As shown earlier, there are 3 ways to specify the object to count: (1) with text only, (2) with text and any number of boxes (i.e., "visual exemplars") around example objects, and (3) with visual exemplars only. What is being used is indicated in the top left of the output image. How to try each case is detailed below.
|
436 |
-
|
437 |
<ol>
|
438 |
<li><strong>Text Only: </strong> Only provide text describing the object to count in the textbox titled "What would you like to count?" Delete all boxes drawn on the visual exemplar image.</li>
|
439 |
<li><strong>Text + Visual Exemplars: </strong> Provide text describing the object to count in the textbox titled "What would you like to count?" and draw at least one box around an example object in the visual exemplar image.</li>
|
440 |
<li><strong>Visual Exemplars Only: </strong> Remove all text in the textbox titled "What would you like to count?" and draw at least one box around an example object in the visual exemplar image.</li>
|
441 |
</ol>
|
442 |
-
|
443 |
## Click on the "App" tab at the top of the screen to exit the tutorial and start using the main app!
|
444 |
"""
|
445 |
|
@@ -499,4 +496,4 @@ with gr.Blocks(title="CountGD: Multi-Modal Open-World Counting", theme="soft", h
|
|
499 |
clear_btn_main.add([input_image_main, input_text_main, exemplar_image_main, detected_instances_main, pred_count_main])
|
500 |
|
501 |
|
502 |
-
demo.launch(allowed_paths=['back-icon.jpg', 'paste-icon.jpg', 'upload-icon.jpg', 'button-legend.jpg'])
|
|
|
35 |
)
|
36 |
)
|
37 |
from gradio_image_prompter import ImagePrompter
|
38 |
+
"""
|
39 |
subprocess.run(
|
40 |
shlex.split(
|
41 |
"pip install MultiScaleDeformableAttention-1.0-cp310-cp310-linux_x86_64.whl"
|
42 |
)
|
43 |
)
|
44 |
+
"""
|
45 |
"""
|
46 |
subprocess.run(
|
47 |
shlex.split(
|
|
|
53 |
# script = file.read()
|
54 |
#call(script, shell=True)
|
55 |
|
56 |
+
with open('./build_ops.sh', 'rb') as file:
|
57 |
+
script = file.read()
|
58 |
+
call(script, shell=True)
|
59 |
|
60 |
def find_cuda():
|
61 |
# Check if CUDA_HOME or CUDA_PATH environment variables are set
|
|
|
89 |
def get_args_parser():
|
90 |
"""
|
91 |
Example eval command:
|
|
|
92 |
>> python main.py --output_dir ./gdino_test -c config/cfg_fsc147_vit_b_test.py --eval --datasets config/datasets_fsc147.json --pretrain_model_path ../checkpoints_and_logs/gdino_train/checkpoint_best_regular.pth --options text_encoder_type=checkpoints/bert-base-uncased --sam_tt_norm --crop
|
93 |
"""
|
94 |
parser = argparse.ArgumentParser("Set transformer detector", add_help=False)
|
|
|
432 |
instructions_main = """
|
433 |
# How to Use the App
|
434 |
As shown earlier, there are 3 ways to specify the object to count: (1) with text only, (2) with text and any number of boxes (i.e., "visual exemplars") around example objects, and (3) with visual exemplars only. What is being used is indicated in the top left of the output image. How to try each case is detailed below.
|
|
|
435 |
<ol>
|
436 |
<li><strong>Text Only: </strong> Only provide text describing the object to count in the textbox titled "What would you like to count?" Delete all boxes drawn on the visual exemplar image.</li>
|
437 |
<li><strong>Text + Visual Exemplars: </strong> Provide text describing the object to count in the textbox titled "What would you like to count?" and draw at least one box around an example object in the visual exemplar image.</li>
|
438 |
<li><strong>Visual Exemplars Only: </strong> Remove all text in the textbox titled "What would you like to count?" and draw at least one box around an example object in the visual exemplar image.</li>
|
439 |
</ol>
|
|
|
440 |
## Click on the "App" tab at the top of the screen to exit the tutorial and start using the main app!
|
441 |
"""
|
442 |
|
|
|
496 |
clear_btn_main.add([input_image_main, input_text_main, exemplar_image_main, detected_instances_main, pred_count_main])
|
497 |
|
498 |
|
499 |
+
demo.launch(allowed_paths=['back-icon.jpg', 'paste-icon.jpg', 'upload-icon.jpg', 'button-legend.jpg'])
|