Abhishek Gola
commited on
Commit
·
41a18e3
1
Parent(s):
2add147
Added samples
Browse files- .gitattributes +5 -0
- app.py +38 -7
- examples/handwave.mp4 +3 -0
- examples/handwave2.mp4 +3 -0
.gitattributes
CHANGED
@@ -14,6 +14,11 @@
|
|
14 |
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
*.onnx filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
17 |
*.ot filter=lfs diff=lfs merge=lfs -text
|
18 |
*.parquet filter=lfs diff=lfs merge=lfs -text
|
19 |
*.pb filter=lfs diff=lfs merge=lfs -text
|
|
|
14 |
*.npy filter=lfs diff=lfs merge=lfs -text
|
15 |
*.npz filter=lfs diff=lfs merge=lfs -text
|
16 |
*.onnx filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.gif filter=lfs diff=lfs merge=lfs -text
|
20 |
+
*.png filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.webp filter=lfs diff=lfs merge=lfs -te
|
22 |
*.ot filter=lfs diff=lfs merge=lfs -text
|
23 |
*.parquet filter=lfs diff=lfs merge=lfs -text
|
24 |
*.pb filter=lfs diff=lfs merge=lfs -text
|
app.py
CHANGED
@@ -158,10 +158,41 @@ def process_video(video_path):
|
|
158 |
out_writer.release()
|
159 |
return out_path
|
160 |
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
out_writer.release()
|
159 |
return out_path
|
160 |
|
161 |
+
# Gradio Interface
|
162 |
+
with gr.Blocks(css='''.example * {
|
163 |
+
font-style: italic;
|
164 |
+
font-size: 18px !important;
|
165 |
+
color: #0ea5e9 !important;
|
166 |
+
}''') as demo:
|
167 |
+
|
168 |
+
gr.Markdown("### Handpose Estimation with Mediapipe using OpenCV")
|
169 |
+
gr.Markdown("Upload a video to palm detection followed by hand pose estimation using MediaPipe and OpenCV")
|
170 |
+
|
171 |
+
with gr.Row():
|
172 |
+
inputs=gr.Video(label="Upload Video")
|
173 |
+
outputs=gr.Video(label="Handpose Estimation Output")
|
174 |
+
|
175 |
+
# Clear output when new video is uploaded
|
176 |
+
inputs.change(fn=lambda: (None), outputs=outputs)
|
177 |
+
|
178 |
+
with gr.Row():
|
179 |
+
submit_btn = gr.Button("Submit", variant="primary")
|
180 |
+
clear_btn = gr.Button("Clear")
|
181 |
+
|
182 |
+
submit_btn.click(fn=process_video, inputs=inputs, outputs=outputs)
|
183 |
+
clear_btn.click(fn=lambda:(None, None), outputs=[inputs, outputs])
|
184 |
+
|
185 |
+
gr.Markdown("Click on any example to try it.", elem_classes=["example"])
|
186 |
+
|
187 |
+
gr.Examples(
|
188 |
+
examples=[
|
189 |
+
["examples/handwave.mp4"],
|
190 |
+
["examples/handwave2.mp4"]
|
191 |
+
],
|
192 |
+
inputs=inputs
|
193 |
+
)
|
194 |
+
|
195 |
+
gr.Markdown("Example videos credit: https://pixabay.com/")
|
196 |
+
|
197 |
+
if __name__ == "__main__":
|
198 |
+
demo.launch()
|
examples/handwave.mp4
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:cd5449d1c48ecdd55446282699b9dc9756ee62569ccb009d201bb67d72057909
|
3 |
+
size 954595
|
examples/handwave2.mp4
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e7524c7ff34dad5fcb192fd28a1250d3790088afdb1f348fa94de2aab9de6cb3
|
3 |
+
size 50762928
|