This guide will help you deploy the UPDRS Finger Tapping Test Streamlit application to various platforms.
pip install -r requirements.txtstreamlit run updrs_streamlit.pyThe app will be available at http://localhost:8501
-
Push to GitHub
git add . git commit -m "Add Streamlit UPDRS app" git push origin main
-
Deploy on Streamlit Cloud
- Go to share.streamlit.io
- Sign in with your GitHub account
- Click "New app"
- Select your repository:
chuyicui/tap_test_web - Main file path:
updrs_streamlit.py - Click "Deploy!"
-
Create Procfile
echo "web: streamlit run updrs_streamlit.py --server.port=$PORT --server.address=0.0.0.0" > Procfile
-
Create setup.sh
echo "mkdir -p ~/.streamlit/ echo \"[server] headless = true port = $PORT enableCORS = false \" > ~/.streamlit/config.toml" > setup.sh
-
Deploy to Heroku
heroku create your-app-name git push heroku main
-
Create Dockerfile
FROM python:3.9-slim WORKDIR /app COPY requirements.txt . RUN pip install -r requirements.txt COPY . . EXPOSE 8501 CMD ["streamlit", "run", "updrs_streamlit.py", "--server.port=8501", "--server.address=0.0.0.0"]
-
Build and Run
docker build -t updrs-streamlit . docker run -p 8501:8501 updrs-streamlit
-
Launch EC2 Instance
- Choose Ubuntu 20.04 LTS
- Configure security group to allow port 8501
-
Install Dependencies
sudo apt update sudo apt install python3-pip pip3 install -r requirements.txt
-
Run Application
streamlit run updrs_streamlit.py --server.port=8501 --server.address=0.0.0.0
You can set these environment variables for configuration:
STREAMLIT_SERVER_PORT: Port number (default: 8501)STREAMLIT_SERVER_ADDRESS: Server address (default: localhost)STREAMLIT_SERVER_HEADLESS: Run in headless mode (default: false)
For camera access in deployed environments:
- Local Development: Camera should work automatically
- Cloud Deployment: May require additional configuration for camera access
- Alternative: Use webcam simulation or file upload for testing
- ✅ Mood assessment questionnaire
- ✅ Right and left hand finger tapping tests
- ✅ Real-time hand tracking with MediaPipe
- ✅ Tap detection and counting
- ✅ Distance measurement and visualization
- ✅ Results analysis with charts
- ✅ PDF report generation
- ✅ Session state management
- Modern, responsive design
- Interactive charts with Plotly
- Progress tracking
- Real-time metrics
- Downloadable reports
-
Camera not working
- Check camera permissions
- Ensure camera is not being used by another application
- For cloud deployment, camera access may be limited
-
MediaPipe installation issues
pip install --upgrade mediapipe
-
Streamlit not starting
streamlit --version pip install --upgrade streamlit
- Reduce camera resolution for better performance
- Adjust MediaPipe confidence thresholds
- Use caching for expensive operations
- HTTPS: Always use HTTPS in production
- Authentication: Add user authentication if needed
- Data Privacy: Ensure patient data is handled securely
- Camera Access: Implement proper camera access controls
Streamlit provides built-in logging. Check logs for:
- Application errors
- Performance metrics
- User interactions
Consider adding:
- User session tracking
- Performance metrics
- Error monitoring
For issues or questions:
- Check the Streamlit documentation
- Review the MediaPipe documentation
- Check the application logs
- Test locally before deploying
This application is for educational and research purposes. Ensure compliance with medical device regulations if used in clinical settings.