The Space Station Object Detection app now includes live webcam functionality for real-time detection of:
- 🔧 Toolbox
- 🧯 Fire Extinguisher
- 🫧 Oxygen Tank
pip install streamlit-webrtc avOr install all requirements:
pip install -r requirements.txt- Operating System: Windows 10/11, macOS, or Linux
- Webcam: Any USB webcam or built-in camera
- Browser: Chrome, Firefox, Safari, or Edge (with WebRTC support)
- Internet: Required for WebRTC connection
streamlit run app.py- In the sidebar, select a trained model from the dropdown
- Click "Load Model" button
- Wait for the success message
- Click on the "📹 Live Webcam" tab
- Click "Start Webcam" to begin live detection
- Point your camera at objects to detect
- View real-time detection results and statistics
- Real-time object detection with bounding boxes
- Confidence scores displayed on each detection
- Color-coded detection boxes for each object type
- Real-time detection counts by object type
- Interactive pie chart showing detection distribution
- Recent detection history (last 10 detections)
- Download detection logs as CSV
- Generate session reports in Markdown format
- Track detection timestamps and confidence scores
- Check Browser Permissions: Allow camera access when prompted
- Try Different Browser: Some browsers have better WebRTC support
- Check Webcam: Ensure webcam is not being used by another application
- Test Basic Webcam: Run
test_webcam.pyto verify basic functionality
- Lower Detection FPS: Reduce the detection FPS slider in settings
- Close Other Applications: Free up system resources
- Check Model Size: Use smaller models for better performance
- Check Internet: WebRTC requires internet connection for STUN servers
- Firewall: Ensure firewall allows WebRTC connections
- Corporate Network: Some corporate networks block WebRTC
- Toolbox (Class 0): Various types of toolboxes
- Fire Extinguisher (Class 2): Fire extinguishers
- Oxygen Tank (Class 1): Oxygen tanks
runs/detect/train/weights/best.pt- Best model from training run 1runs/detect/train2/weights/best.pt- Best model from training run 2
- Confidence Threshold: Adjust minimum confidence for detections (0.1-0.9)
- Detection FPS: Control how often detection runs (1-30 FPS)
- Show Confidence: Toggle confidence score display
- Detection runs every 3 frames by default for performance
- Queue system prevents memory overflow
- Automatic cleanup of old detection history
- Webcam access requires user permission
- No video data is stored permanently
- All processing happens locally in the browser
- Detection results can be downloaded for analysis
If you encounter issues:
- Check the troubleshooting section above
- Run the test script:
streamlit run test_webcam.py - Verify all dependencies are installed correctly
- Check browser console for error messages