Spaces:
Running on Zero
Running on Zero
Update
Browse files- README.md +1 -1
- app.py +9 -2
- pyproject.toml +2 -2
- requirements.txt +28 -24
- uv.lock +0 -0
README.md
CHANGED
|
@@ -5,7 +5,7 @@ colorFrom: yellow
|
|
| 5 |
colorTo: green
|
| 6 |
sdk: gradio
|
| 7 |
python_version: 3.12.12
|
| 8 |
-
sdk_version: 6.
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
---
|
|
|
|
| 5 |
colorTo: green
|
| 6 |
sdk: gradio
|
| 7 |
python_version: 3.12.12
|
| 8 |
+
sdk_version: 6.10.0
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
---
|
app.py
CHANGED
|
@@ -216,7 +216,9 @@ def _detect_vitpose(
|
|
| 216 |
forward_kwargs = dict(pose_inputs)
|
| 217 |
if VITPOSE_IS_MOE:
|
| 218 |
# COCO dataset index = 0 for vitpose-plus MoE heads
|
| 219 |
-
forward_kwargs["dataset_index"] = torch.zeros(
|
|
|
|
|
|
|
| 220 |
pose_outputs = vitpose_model(**forward_kwargs)
|
| 221 |
pose_results = vitpose_processor.post_process_pose_estimation(pose_outputs, boxes=[person_boxes_coco])
|
| 222 |
|
|
@@ -330,7 +332,12 @@ with gr.Blocks(title="Detection Viewer Demo") as demo:
|
|
| 330 |
gr.Examples(
|
| 331 |
examples=[
|
| 332 |
[str(ASSETS_DIR / "kitchen.jpg"), TASK_OBJECT_DETECTION, "", 0.3],
|
| 333 |
-
[
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 334 |
[str(ASSETS_DIR / "traffic.jpg"), TASK_INSTANCE_SEGMENTATION, "", 0.3],
|
| 335 |
[str(ASSETS_DIR / "people.jpg"), TASK_POSE_ESTIMATION, "", 0.3],
|
| 336 |
],
|
|
|
|
| 216 |
forward_kwargs = dict(pose_inputs)
|
| 217 |
if VITPOSE_IS_MOE:
|
| 218 |
# COCO dataset index = 0 for vitpose-plus MoE heads
|
| 219 |
+
forward_kwargs["dataset_index"] = torch.zeros(
|
| 220 |
+
pose_inputs["pixel_values"].shape[0], dtype=torch.long, device=device
|
| 221 |
+
)
|
| 222 |
pose_outputs = vitpose_model(**forward_kwargs)
|
| 223 |
pose_results = vitpose_processor.post_process_pose_estimation(pose_outputs, boxes=[person_boxes_coco])
|
| 224 |
|
|
|
|
| 332 |
gr.Examples(
|
| 333 |
examples=[
|
| 334 |
[str(ASSETS_DIR / "kitchen.jpg"), TASK_OBJECT_DETECTION, "", 0.3],
|
| 335 |
+
[
|
| 336 |
+
str(ASSETS_DIR / "office.jpg"),
|
| 337 |
+
TASK_ZERO_SHOT_DETECTION,
|
| 338 |
+
"person, laptop, notebook, pencil, glasses, watch, potted plant, bookshelf, window",
|
| 339 |
+
0.3,
|
| 340 |
+
],
|
| 341 |
[str(ASSETS_DIR / "traffic.jpg"), TASK_INSTANCE_SEGMENTATION, "", 0.3],
|
| 342 |
[str(ASSETS_DIR / "people.jpg"), TASK_POSE_ESTIMATION, "", 0.3],
|
| 343 |
],
|
pyproject.toml
CHANGED
|
@@ -6,7 +6,7 @@ readme = "README.md"
|
|
| 6 |
requires-python = ">=3.12"
|
| 7 |
dependencies = [
|
| 8 |
"detection-viewer",
|
| 9 |
-
"gradio>=6.
|
| 10 |
"scipy>=1.17.1",
|
| 11 |
"spaces>=0.47.0",
|
| 12 |
"torch==2.9.1",
|
|
@@ -63,4 +63,4 @@ convention = "google"
|
|
| 63 |
docstring-code-format = true
|
| 64 |
|
| 65 |
[tool.uv.sources]
|
| 66 |
-
detection-viewer = { url = "https://github.com/hysts/gradio-detection-viewer/releases/download/v0.1.
|
|
|
|
| 6 |
requires-python = ">=3.12"
|
| 7 |
dependencies = [
|
| 8 |
"detection-viewer",
|
| 9 |
+
"gradio>=6.10.0",
|
| 10 |
"scipy>=1.17.1",
|
| 11 |
"spaces>=0.47.0",
|
| 12 |
"torch==2.9.1",
|
|
|
|
| 63 |
docstring-code-format = true
|
| 64 |
|
| 65 |
[tool.uv.sources]
|
| 66 |
+
detection-viewer = { url = "https://github.com/hysts/gradio-detection-viewer/releases/download/v0.1.6/detection_viewer-0.1.6-py3-none-any.whl" }
|
requirements.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
# This file was autogenerated by uv via the following command:
|
| 2 |
-
# uv export --no-hashes --group hf-spaces --no-emit-package typer-slim -o requirements.txt
|
| 3 |
aiofiles==24.1.0
|
| 4 |
# via gradio
|
| 5 |
aiohappyeyeballs==2.6.1
|
|
@@ -14,12 +14,12 @@ annotated-doc==0.0.4
|
|
| 14 |
# typer
|
| 15 |
annotated-types==0.7.0
|
| 16 |
# via pydantic
|
| 17 |
-
anyio==4.
|
| 18 |
# via
|
| 19 |
# gradio
|
| 20 |
# httpx
|
| 21 |
# starlette
|
| 22 |
-
attrs==
|
| 23 |
# via aiohttp
|
| 24 |
audioop-lts==0.2.2 ; python_full_version >= '3.13'
|
| 25 |
# via gradio
|
|
@@ -30,7 +30,7 @@ certifi==2026.2.25
|
|
| 30 |
# httpcore
|
| 31 |
# httpx
|
| 32 |
# requests
|
| 33 |
-
charset-normalizer==3.4.
|
| 34 |
# via requests
|
| 35 |
click==8.3.1
|
| 36 |
# via
|
|
@@ -40,18 +40,18 @@ colorama==0.4.6 ; sys_platform == 'win32'
|
|
| 40 |
# via
|
| 41 |
# click
|
| 42 |
# tqdm
|
| 43 |
-
datasets==4.
|
| 44 |
-
detection-viewer @ https://github.com/hysts/gradio-detection-viewer/releases/download/v0.1.
|
| 45 |
# via detection-viewer-demo
|
| 46 |
-
dill==0.4.
|
| 47 |
# via
|
| 48 |
# datasets
|
| 49 |
# multiprocess
|
| 50 |
-
fastapi==0.
|
| 51 |
# via gradio
|
| 52 |
ffmpy==1.0.0
|
| 53 |
# via gradio
|
| 54 |
-
filelock==3.
|
| 55 |
# via
|
| 56 |
# datasets
|
| 57 |
# huggingface-hub
|
|
@@ -66,20 +66,24 @@ fsspec==2026.2.0
|
|
| 66 |
# gradio-client
|
| 67 |
# huggingface-hub
|
| 68 |
# torch
|
| 69 |
-
gradio==6.
|
| 70 |
# via
|
| 71 |
# detection-viewer
|
| 72 |
# detection-viewer-demo
|
| 73 |
# spaces
|
| 74 |
-
gradio-client==2.
|
| 75 |
-
# via
|
|
|
|
|
|
|
| 76 |
groovy==0.1.2
|
| 77 |
# via gradio
|
| 78 |
h11==0.16.0
|
| 79 |
# via
|
| 80 |
# httpcore
|
| 81 |
# uvicorn
|
| 82 |
-
hf-
|
|
|
|
|
|
|
| 83 |
# via huggingface-hub
|
| 84 |
httpcore==1.0.9
|
| 85 |
# via httpx
|
|
@@ -91,7 +95,7 @@ httpx==0.28.1
|
|
| 91 |
# huggingface-hub
|
| 92 |
# safehttpx
|
| 93 |
# spaces
|
| 94 |
-
huggingface-hub==1.
|
| 95 |
# via
|
| 96 |
# datasets
|
| 97 |
# gradio
|
|
@@ -122,11 +126,11 @@ multidict==6.7.1
|
|
| 122 |
# via
|
| 123 |
# aiohttp
|
| 124 |
# yarl
|
| 125 |
-
multiprocess==0.70.
|
| 126 |
# via datasets
|
| 127 |
networkx==3.6.1
|
| 128 |
# via torch
|
| 129 |
-
numpy==2.4.
|
| 130 |
# via
|
| 131 |
# datasets
|
| 132 |
# gradio
|
|
@@ -211,7 +215,7 @@ python-dateutil==2.9.0.post0
|
|
| 211 |
# via pandas
|
| 212 |
python-multipart==0.0.22
|
| 213 |
# via gradio
|
| 214 |
-
pytz==
|
| 215 |
# via gradio
|
| 216 |
pyyaml==6.0.3
|
| 217 |
# via
|
|
@@ -227,7 +231,6 @@ requests==2.32.5
|
|
| 227 |
# spaces
|
| 228 |
rich==14.3.3
|
| 229 |
# via typer
|
| 230 |
-
ruff==0.15.4
|
| 231 |
safehttpx==0.1.7
|
| 232 |
# via gradio
|
| 233 |
safetensors==0.7.0
|
|
@@ -236,13 +239,13 @@ scipy==1.17.1
|
|
| 236 |
# via detection-viewer-demo
|
| 237 |
semantic-version==2.10.0
|
| 238 |
# via gradio
|
| 239 |
-
setuptools==82.0.
|
| 240 |
# via torch
|
| 241 |
shellingham==1.5.4
|
| 242 |
# via typer
|
| 243 |
six==1.17.0
|
| 244 |
# via python-dateutil
|
| 245 |
-
spaces==0.
|
| 246 |
# via detection-viewer-demo
|
| 247 |
starlette==0.52.1
|
| 248 |
# via
|
|
@@ -261,15 +264,16 @@ tqdm==4.67.3
|
|
| 261 |
# datasets
|
| 262 |
# huggingface-hub
|
| 263 |
# transformers
|
| 264 |
-
transformers==5.
|
| 265 |
# via detection-viewer-demo
|
| 266 |
triton==3.5.1 ; platform_machine == 'x86_64' and sys_platform == 'linux'
|
| 267 |
# via torch
|
| 268 |
typer==0.24.1
|
| 269 |
# via
|
| 270 |
# gradio
|
|
|
|
| 271 |
# huggingface-hub
|
| 272 |
-
#
|
| 273 |
typing-extensions==4.15.0
|
| 274 |
# via
|
| 275 |
# aiosignal
|
|
@@ -292,9 +296,9 @@ tzdata==2025.3 ; sys_platform == 'emscripten' or sys_platform == 'win32'
|
|
| 292 |
# via pandas
|
| 293 |
urllib3==2.6.3
|
| 294 |
# via requests
|
| 295 |
-
uvicorn==0.
|
| 296 |
# via gradio
|
| 297 |
xxhash==3.6.0
|
| 298 |
# via datasets
|
| 299 |
-
yarl==1.
|
| 300 |
# via aiohttp
|
|
|
|
| 1 |
# This file was autogenerated by uv via the following command:
|
| 2 |
+
# uv export --no-hashes --no-dev --group hf-spaces --no-emit-package typer-slim -o requirements.txt
|
| 3 |
aiofiles==24.1.0
|
| 4 |
# via gradio
|
| 5 |
aiohappyeyeballs==2.6.1
|
|
|
|
| 14 |
# typer
|
| 15 |
annotated-types==0.7.0
|
| 16 |
# via pydantic
|
| 17 |
+
anyio==4.13.0
|
| 18 |
# via
|
| 19 |
# gradio
|
| 20 |
# httpx
|
| 21 |
# starlette
|
| 22 |
+
attrs==26.1.0
|
| 23 |
# via aiohttp
|
| 24 |
audioop-lts==0.2.2 ; python_full_version >= '3.13'
|
| 25 |
# via gradio
|
|
|
|
| 30 |
# httpcore
|
| 31 |
# httpx
|
| 32 |
# requests
|
| 33 |
+
charset-normalizer==3.4.6
|
| 34 |
# via requests
|
| 35 |
click==8.3.1
|
| 36 |
# via
|
|
|
|
| 40 |
# via
|
| 41 |
# click
|
| 42 |
# tqdm
|
| 43 |
+
datasets==4.8.4
|
| 44 |
+
detection-viewer @ https://github.com/hysts/gradio-detection-viewer/releases/download/v0.1.6/detection_viewer-0.1.6-py3-none-any.whl
|
| 45 |
# via detection-viewer-demo
|
| 46 |
+
dill==0.4.1
|
| 47 |
# via
|
| 48 |
# datasets
|
| 49 |
# multiprocess
|
| 50 |
+
fastapi==0.135.2
|
| 51 |
# via gradio
|
| 52 |
ffmpy==1.0.0
|
| 53 |
# via gradio
|
| 54 |
+
filelock==3.25.2
|
| 55 |
# via
|
| 56 |
# datasets
|
| 57 |
# huggingface-hub
|
|
|
|
| 66 |
# gradio-client
|
| 67 |
# huggingface-hub
|
| 68 |
# torch
|
| 69 |
+
gradio==6.10.0
|
| 70 |
# via
|
| 71 |
# detection-viewer
|
| 72 |
# detection-viewer-demo
|
| 73 |
# spaces
|
| 74 |
+
gradio-client==2.4.0
|
| 75 |
+
# via
|
| 76 |
+
# gradio
|
| 77 |
+
# hf-gradio
|
| 78 |
groovy==0.1.2
|
| 79 |
# via gradio
|
| 80 |
h11==0.16.0
|
| 81 |
# via
|
| 82 |
# httpcore
|
| 83 |
# uvicorn
|
| 84 |
+
hf-gradio==0.3.0
|
| 85 |
+
# via gradio
|
| 86 |
+
hf-xet==1.4.2 ; platform_machine == 'AMD64' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'arm64' or platform_machine == 'x86_64'
|
| 87 |
# via huggingface-hub
|
| 88 |
httpcore==1.0.9
|
| 89 |
# via httpx
|
|
|
|
| 95 |
# huggingface-hub
|
| 96 |
# safehttpx
|
| 97 |
# spaces
|
| 98 |
+
huggingface-hub==1.7.2
|
| 99 |
# via
|
| 100 |
# datasets
|
| 101 |
# gradio
|
|
|
|
| 126 |
# via
|
| 127 |
# aiohttp
|
| 128 |
# yarl
|
| 129 |
+
multiprocess==0.70.19
|
| 130 |
# via datasets
|
| 131 |
networkx==3.6.1
|
| 132 |
# via torch
|
| 133 |
+
numpy==2.4.3
|
| 134 |
# via
|
| 135 |
# datasets
|
| 136 |
# gradio
|
|
|
|
| 215 |
# via pandas
|
| 216 |
python-multipart==0.0.22
|
| 217 |
# via gradio
|
| 218 |
+
pytz==2026.1.post1
|
| 219 |
# via gradio
|
| 220 |
pyyaml==6.0.3
|
| 221 |
# via
|
|
|
|
| 231 |
# spaces
|
| 232 |
rich==14.3.3
|
| 233 |
# via typer
|
|
|
|
| 234 |
safehttpx==0.1.7
|
| 235 |
# via gradio
|
| 236 |
safetensors==0.7.0
|
|
|
|
| 239 |
# via detection-viewer-demo
|
| 240 |
semantic-version==2.10.0
|
| 241 |
# via gradio
|
| 242 |
+
setuptools==82.0.1
|
| 243 |
# via torch
|
| 244 |
shellingham==1.5.4
|
| 245 |
# via typer
|
| 246 |
six==1.17.0
|
| 247 |
# via python-dateutil
|
| 248 |
+
spaces==0.48.0
|
| 249 |
# via detection-viewer-demo
|
| 250 |
starlette==0.52.1
|
| 251 |
# via
|
|
|
|
| 264 |
# datasets
|
| 265 |
# huggingface-hub
|
| 266 |
# transformers
|
| 267 |
+
transformers==5.3.0
|
| 268 |
# via detection-viewer-demo
|
| 269 |
triton==3.5.1 ; platform_machine == 'x86_64' and sys_platform == 'linux'
|
| 270 |
# via torch
|
| 271 |
typer==0.24.1
|
| 272 |
# via
|
| 273 |
# gradio
|
| 274 |
+
# hf-gradio
|
| 275 |
# huggingface-hub
|
| 276 |
+
# transformers
|
| 277 |
typing-extensions==4.15.0
|
| 278 |
# via
|
| 279 |
# aiosignal
|
|
|
|
| 296 |
# via pandas
|
| 297 |
urllib3==2.6.3
|
| 298 |
# via requests
|
| 299 |
+
uvicorn==0.42.0
|
| 300 |
# via gradio
|
| 301 |
xxhash==3.6.0
|
| 302 |
# via datasets
|
| 303 |
+
yarl==1.23.0
|
| 304 |
# via aiohttp
|
uv.lock
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|