pierrequereuil commited on
Commit
0b4a225
·
verified ·
1 Parent(s): edc36df

Upload folder using huggingface_hub

Browse files
Files changed (8) hide show
  1. .gitattributes +2 -0
  2. .gitignore +3 -0
  3. README.md +2 -8
  4. app.py +37 -0
  5. assets/basketball.mp4 +3 -0
  6. assets/pierre.mov +3 -0
  7. models/pose.pt +3 -0
  8. requirements.txt +69 -0
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ assets/basketball.mp4 filter=lfs diff=lfs merge=lfs -text
37
+ assets/pierre.mov filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ .venv
2
+ node_modules
3
+ tests
README.md CHANGED
@@ -1,12 +1,6 @@
1
  ---
2
- title: Human Pose Video
3
- emoji: 🐢
4
- colorFrom: green
5
- colorTo: blue
6
  sdk: gradio
7
  sdk_version: 4.42.0
8
- app_file: app.py
9
- pinned: false
10
  ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: human-pose-video
3
+ app_file: app.py
 
 
4
  sdk: gradio
5
  sdk_version: 4.42.0
 
 
6
  ---
 
 
app.py ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import PIL.Image as Image
3
+ from ultralytics import YOLO
4
+
5
+ pose = YOLO("models/pose.pt")
6
+
7
+
8
+ def predict_image(image, conf_threshold, iou_threshold):
9
+ results = pose.predict(
10
+ image, conf=conf_threshold, iou=iou_threshold, stream=True)
11
+
12
+ for r in results:
13
+ im_array = r.plot(labels=True, boxes=True)
14
+ yield Image.fromarray(im_array[..., ::-1])
15
+
16
+ return image
17
+
18
+
19
+ iface = gr.Interface(
20
+ fn=predict_image,
21
+ inputs=[
22
+ gr.Video(label="Upload Video"),
23
+ gr.Slider(minimum=0, maximum=1, value=0.25,
24
+ label="Confidence threshold"),
25
+ gr.Slider(minimum=0, maximum=1, value=0.7, label="IoU threshold"),
26
+ ],
27
+ outputs=gr.Image(type="numpy", label="Result"),
28
+ title="Human Pose",
29
+ description="Limbs in all of the right places.",
30
+ examples=[
31
+ ["assets/pierre.mov", 0.25, 0.7],
32
+ ["assets/basketball.mp4", 0.25, 0.7],
33
+ ]
34
+ )
35
+
36
+ if __name__ == "__main__":
37
+ iface.launch()
assets/basketball.mp4 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1996f65f6335c4bbdf436a992ee3f7d9db7a60bbd113f7305c53e572c7260759
3
+ size 30162927
assets/pierre.mov ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:64e020d6ad93a93c0134b1e881941ca14c16bcddade5b795e0ef155554d00b61
3
+ size 51297175
models/pose.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a14086802581046de9b39939924440523252cd5a47361081e802984ddf714ea1
3
+ size 89391502
requirements.txt ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiofiles==23.2.1
2
+ annotated-types==0.7.0
3
+ anyio==4.4.0
4
+ certifi==2024.7.4
5
+ charset-normalizer==3.3.2
6
+ click==8.1.7
7
+ contourpy==1.3.0
8
+ cycler==0.12.1
9
+ fastapi==0.112.2
10
+ ffmpy==0.4.0
11
+ filelock==3.15.4
12
+ fonttools==4.53.1
13
+ fsspec==2024.6.1
14
+ gradio==4.42.0
15
+ gradio_client==1.3.0
16
+ h11==0.14.0
17
+ httpcore==1.0.5
18
+ httpx==0.27.2
19
+ huggingface-hub==0.24.6
20
+ idna==3.8
21
+ importlib_resources==6.4.4
22
+ Jinja2==3.1.4
23
+ kiwisolver==1.4.5
24
+ markdown-it-py==3.0.0
25
+ MarkupSafe==2.1.5
26
+ matplotlib==3.9.2
27
+ mdurl==0.1.2
28
+ mpmath==1.3.0
29
+ networkx==3.3
30
+ numpy==1.26.4
31
+ opencv-python==4.10.0.84
32
+ orjson==3.10.7
33
+ packaging==24.1
34
+ pandas==2.2.2
35
+ pillow==10.4.0
36
+ psutil==6.0.0
37
+ py-cpuinfo==9.0.0
38
+ pydantic==2.8.2
39
+ pydantic_core==2.20.1
40
+ pydub==0.25.1
41
+ Pygments==2.18.0
42
+ pyparsing==3.1.4
43
+ python-dateutil==2.9.0.post0
44
+ python-multipart==0.0.9
45
+ pytz==2024.1
46
+ PyYAML==6.0.2
47
+ requests==2.32.3
48
+ rich==13.8.0
49
+ ruff==0.6.2
50
+ scipy==1.14.1
51
+ seaborn==0.13.2
52
+ semantic-version==2.10.0
53
+ shellingham==1.5.4
54
+ six==1.16.0
55
+ sniffio==1.3.1
56
+ starlette==0.38.2
57
+ sympy==1.13.2
58
+ tomlkit==0.12.0
59
+ torch==2.4.0
60
+ torchvision==0.19.0
61
+ tqdm==4.66.5
62
+ typer==0.12.5
63
+ typing_extensions==4.12.2
64
+ tzdata==2024.1
65
+ ultralytics==8.2.83
66
+ ultralytics-thop==2.0.5
67
+ urllib3==2.2.2
68
+ uvicorn==0.30.6
69
+ websockets==12.0