Spaces:
Sleeping
Sleeping
Fix 403 error (CORS) and change default mode to Hand Tracking
Browse files- Dockerfile +1 -1
- app.py +5 -1
Dockerfile
CHANGED
|
@@ -24,4 +24,4 @@ COPY . .
|
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
# Run the application
|
| 27 |
-
CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]
|
|
|
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
# Run the application
|
| 27 |
+
CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0", "--server.enableCORS", "false", "--server.enableXsrfProtection", "false"]
|
app.py
CHANGED
|
@@ -133,7 +133,7 @@ with st.sidebar:
|
|
| 133 |
mode_label = st.selectbox(
|
| 134 |
"Detection Mode",
|
| 135 |
options=[m.value for m in DetectionMode],
|
| 136 |
-
index=
|
| 137 |
help="Choose what the detector should look for.",
|
| 138 |
)
|
| 139 |
mode = DetectionMode(mode_label)
|
|
@@ -291,6 +291,10 @@ with tab_webcam:
|
|
| 291 |
"Take a photo with your webcam and the detector will process it instantly."
|
| 292 |
)
|
| 293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
camera_input = st.camera_input("📷 Take a photo")
|
| 295 |
|
| 296 |
if camera_input is not None:
|
|
|
|
| 133 |
mode_label = st.selectbox(
|
| 134 |
"Detection Mode",
|
| 135 |
options=[m.value for m in DetectionMode],
|
| 136 |
+
index=0,
|
| 137 |
help="Choose what the detector should look for.",
|
| 138 |
)
|
| 139 |
mode = DetectionMode(mode_label)
|
|
|
|
| 291 |
"Take a photo with your webcam and the detector will process it instantly."
|
| 292 |
)
|
| 293 |
|
| 294 |
+
if mode == DetectionMode.MOTION_DETECTION:
|
| 295 |
+
st.warning("⚠️ **Motion Detection** requires a video stream to compare frames. For a single photo, use **Hand Tracking** or **Combined** mode.")
|
| 296 |
+
|
| 297 |
+
|
| 298 |
camera_input = st.camera_input("📷 Take a photo")
|
| 299 |
|
| 300 |
if camera_input is not None:
|