Spaces:
Running
on
Zero
Running
on
Zero
Darius Morawiec
commited on
Commit
·
4f11b08
1
Parent(s):
2504e22
Update and extend description
Browse files
app.py
CHANGED
|
@@ -20,16 +20,16 @@ os.environ["CUDA_VISIBLE_DEVICES"] = "0"
|
|
| 20 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 21 |
|
| 22 |
model_ids = [
|
| 23 |
-
"Qwen/Qwen2-VL-2B-Instruct",
|
| 24 |
-
"Qwen/Qwen2-VL-7B-Instruct",
|
| 25 |
-
"Qwen/Qwen2.5-VL-3B-Instruct",
|
| 26 |
-
"Qwen/Qwen2.5-VL-7B-Instruct",
|
| 27 |
-
"Qwen/Qwen2.5-VL-32B-Instruct",
|
| 28 |
-
"Qwen/Qwen2.5-VL-72B-Instruct",
|
| 29 |
-
"Qwen/Qwen3-VL-2B-Instruct",
|
| 30 |
-
"Qwen/Qwen3-VL-4B-Instruct",
|
| 31 |
-
"Qwen/Qwen3-VL-8B-Instruct",
|
| 32 |
-
"Qwen/Qwen3-VL-32B-Instruct",
|
| 33 |
]
|
| 34 |
|
| 35 |
|
|
@@ -41,7 +41,10 @@ def image_to_base64(image):
|
|
| 41 |
|
| 42 |
|
| 43 |
with gr.Blocks() as demo:
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
if DEVICE != "cuda":
|
| 47 |
gr.Markdown(
|
|
@@ -69,7 +72,7 @@ with gr.Blocks() as demo:
|
|
| 69 |
lines=3,
|
| 70 |
value=default_system_prompt,
|
| 71 |
)
|
| 72 |
-
default_user_prompt = "detect
|
| 73 |
user_prompt = gr.Textbox(
|
| 74 |
label="User Prompt:",
|
| 75 |
lines=3,
|
|
|
|
| 20 |
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
|
| 21 |
|
| 22 |
model_ids = [
|
| 23 |
+
"Qwen/Qwen2-VL-2B-Instruct", # https://huggingface.co/Qwen/Qwen2-VL-2B-Instruct
|
| 24 |
+
"Qwen/Qwen2-VL-7B-Instruct", # https://huggingface.co/Qwen/Qwen2-VL-7B-Instruct
|
| 25 |
+
"Qwen/Qwen2.5-VL-3B-Instruct", # https://huggingface.co/Qwen/Qwen2.5-VL-3B-Instruct
|
| 26 |
+
"Qwen/Qwen2.5-VL-7B-Instruct", # https://huggingface.co/Qwen/Qwen2.5-VL-7B-Instruct
|
| 27 |
+
"Qwen/Qwen2.5-VL-32B-Instruct", # https://huggingface.co/Qwen/Qwen2.5-VL-32B-Instruct
|
| 28 |
+
"Qwen/Qwen2.5-VL-72B-Instruct", # https://huggingface.co/Qwen/Qwen2.5-VL-72B-Instruct
|
| 29 |
+
"Qwen/Qwen3-VL-2B-Instruct", # https://huggingface.co/Qwen/Qwen3-VL-2B-Instruct
|
| 30 |
+
"Qwen/Qwen3-VL-4B-Instruct", # https://huggingface.co/Qwen/Qwen3-VL-4B-Instruct
|
| 31 |
+
"Qwen/Qwen3-VL-8B-Instruct", # https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct
|
| 32 |
+
"Qwen/Qwen3-VL-32B-Instruct", # https://huggingface.co/Qwen/Qwen3-VL-32B-Instruct
|
| 33 |
]
|
| 34 |
|
| 35 |
|
|
|
|
| 41 |
|
| 42 |
|
| 43 |
with gr.Blocks() as demo:
|
| 44 |
+
gr.Markdown("# Qwen-VL Object-Detection")
|
| 45 |
+
gr.Markdown(
|
| 46 |
+
"Compare [Qwen3-VL](https://huggingface.co/collections/Qwen/qwen3-vl), [Qwen2.5-VL](https://huggingface.co/collections/Qwen/qwen25-vl) and [Qwen2-VL](https://huggingface.co/collections/Qwen/qwen2-vl) models by [Qwen](https://huggingface.co/Qwen) for object detection in images."
|
| 47 |
+
)
|
| 48 |
|
| 49 |
if DEVICE != "cuda":
|
| 50 |
gr.Markdown(
|
|
|
|
| 72 |
lines=3,
|
| 73 |
value=default_system_prompt,
|
| 74 |
)
|
| 75 |
+
default_user_prompt = "detect object"
|
| 76 |
user_prompt = gr.Textbox(
|
| 77 |
label="User Prompt:",
|
| 78 |
lines=3,
|