Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pillarszhang/gradio-camera-capture
Gradio Camera Capture Simple Demo
https://github.com/pillarszhang/gradio-camera-capture
Last synced: 20 days ago
JSON representation
Gradio Camera Capture Simple Demo
- Host: GitHub
- URL: https://github.com/pillarszhang/gradio-camera-capture
- Owner: PillarsZhang
- Created: 2023-11-16T21:03:09.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-16T21:36:16.000Z (about 1 year ago)
- Last Synced: 2024-11-01T14:11:56.880Z (2 months ago)
- Language: Python
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gradio Camera Capture Simple Demo
## Usage
```powershell
pip install -r requirements.txt
```---
Launch app (Gradio)
```powershell
python .\main.py app
```---
Capture image
```powershell
python .\main.py image ./temp/default.jpg
python .\main.py image ./temp/1080p.jpg 0,CAP_DSHOW,1920,1080,30.0
```---
Capture Video
```powershell
python .\main.py video ./temp/default.mp4
python .\main.py video ./temp/1080p.mp4 0,CAP_DSHOW,1920,1080,30.0
```## Package
**TL;DR**
```powershell
pip install pyinstaller
pyinstaller .\gradio-camera-capture.spec
```---
**Tip: How to Package Gradio with PyInstaller?**
1. Generate a spec file (same as pyinstaller). [Reference](https://pyinstaller.org/en/stable/spec-files.html#using-spec-files)
```powershell
pyi-makespec --collect-data=gradio_client --collect-data=gradio name.py
```2. Completely bypass PYZ for gradio. [Reference](https://github.com/pyinstaller/pyinstaller/issues/8108#issuecomment-1814076207)
```python
a = Analysis(
...
module_collection_mode={
'gradio': 'py', # Collect gradio package as source .py files
},
)
```3. Finally, generate the executable.
```powershell
pyinstaller name.spec
```