Spaces:
Build error
A newer version of the Gradio SDK is available:
5.20.0
Webcam Demo
We provide a webcam demo tool which integrartes detection and 2D pose estimation for humans and animals. You can simply run the following command:
python demo/webcam_demo.py
It will launch a window to display the webcam video steam with detection and pose estimation results:

Usage Tips
Which model is used in the demo tool?
Please check the following default arguments in the script. You can also choose other models from the MMDetection Model Zoo and MMPose Model Zoo or use your own models.
Model Arguments Detection --det-config
,--det-checkpoint
Human Pose --human-pose-config
,--human-pose-checkpoint
Animal Pose --animal-pose-config
,--animal-pose-checkpoint
Can this tool run without GPU?
Yes, you can set
--device=cpu
and the model inference will be performed on CPU. Of course, this may cause a low inference FPS compared to using GPU devices.Why there is time delay between the pose visualization and the video?
The video I/O and model inference are running asynchronously and the latter usually takes more time for a single frame. To allevidate the time delay, you can:
set
--display-delay=MILLISECONDS
to defer the video stream, according to the inference delay shown at the top left corner. Or,set
--synchronous-mode
to force video stream being aligned with inference results. This may reduce the video display FPS.
Can this tool process video files?
Yes. You can set
--cam-id=VIDEO_FILE_PATH
to run the demo tool in offline mode on a video file. Note that--synchronous-mode
should be set in this case.How to enable/disable the special effects?
The special effects can be enabled/disabled at launch time by setting arguments like
--bugeye
,--sunglasses
, etc. You can also toggle the effects by keyboard shortcuts likeb
,s
when the tool starts.What if my computer doesn't have a camera?
You can use a smart phone as a webcam with apps like Camo or DroidCam.