A real-time object detection system that controls a virtual fan based on the presence of chair and minifan objects.
- Real-time webcam object detection
- Image upload for detection
- Smart fan control logic
- Visual fan simulation
- Multiple camera support
- Confidence threshold adjustment
- Install dependencies:
pip install -r requirements.txt- Run the app:
streamlit run streamlit_app.py-
Push your code to GitHub
- Make sure your
best.ptmodel file is in theDeploy/folder - Commit and push all files
- Make sure your
-
Deploy on Streamlit Cloud
- Go to https://streamlit.io/cloud
- Sign in with GitHub
- Click "New app"
- Select your repository
- Set the app file path to:
Deploy/streamlit_app.py - Click "Deploy"
- Create a new Web Service
- Connect your GitHub repository
- Set build command:
pip install -r Deploy/requirements.txt
- Set start command:
streamlit run Deploy/streamlit_app.py --server.port $PORT --server.address 0.0.0.0
- Connect your GitHub repository
- Railway will auto-detect it's a Python app
- Add environment variable:
PORT=8501
Deploy/
├── streamlit_app.py # Main Streamlit application
├── best.pt # Your trained YOLO model
├── requirements.txt # Python dependencies
├── .streamlit/
│ └── config.toml # Streamlit configuration
└── README.md # This file
- Model: Custom YOLO model (
best.pt) - Classes: chair, minifan
- Input: Images or webcam feed
- Output: Object detection with bounding boxes and fan control
- Webcam not working: Check camera permissions and try different camera indices
- Model not loading: Ensure
best.ptis in the correct location - Deployment issues: Check that all files are committed to GitHub