pip install -r requirements.txt
Launch app (Gradio)
python .\main.py app
Capture image
python .\main.py image ./temp/default.jpg
python .\main.py image ./temp/1080p.jpg 0,CAP_DSHOW,1920,1080,30.0
Capture Video
python .\main.py video ./temp/default.mp4
python .\main.py video ./temp/1080p.mp4 0,CAP_DSHOW,1920,1080,30.0
TL;DR
pip install pyinstaller
pyinstaller .\gradio-camera-capture.spec
Tip: How to Package Gradio with PyInstaller?
-
Generate a spec file (same as pyinstaller). Reference
pyi-makespec --collect-data=gradio_client --collect-data=gradio name.py
-
Completely bypass PYZ for gradio. Reference
a = Analysis( ... module_collection_mode={ 'gradio': 'py', # Collect gradio package as source .py files }, )
-
Finally, generate the executable.
pyinstaller name.spec