File size: 2,359 Bytes
67f4ecf
 
 
 
 
 
 
 
 
 
 
2fdb608
 
 
 
 
 
 
 
67f4ecf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
title: MotionScope Pro
emoji: πŸŽ₯
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860
app_file: app.py
pinned: false
---

# ⚠️ IMPORTANT SETUP STEP
**If you see "Welcome to your static Space"**:
1. Go to the **Settings** tab above.
2. Scroll to **Select Space SDK**.
3. Change it from **Static** to **Docker**.
4. Click **Update Space**.
The app will then build and start!

# πŸŽ₯ MotionScope Pro β€” Movement Detector

A professional Streamlit application combining **MediaPipe hand tracking** and **background subtraction motion detection**.

## Features

| Feature | Description |
|---|---|
| πŸ–οΈ Hand Tracking | Real-time MediaPipe hand landmark detection |
| πŸš— Motion Detection | Background subtraction (MOG2) with contour filtering |
| ⚑ Combined Mode | Both hand tracking + motion detection simultaneously |
| πŸ“Ή Video Upload | Upload MP4/AVI/MOV/MKV β†’ process β†’ download result |
| πŸ“· Webcam Snapshot | Capture a photo and process it instantly |

## How to Download & Run

### Option 1: Run on Hugging Face Spaces
Click the **App** tab above to use the application directly in your browser!

### Option 2: Run Locally

1. **Clone the repository:**
   ```bash
   git clone https://huggingface.co/spaces/Jack1808/MotionScope-Pro
   cd MotionScope-Pro
   ```

2. **Create a virtual environment (recommended):**
   ```bash
   python -m venv venv
   source venv/bin/activate  # On Windows: venv\Scripts\activate
   ```

3. **Install dependencies:**
   ```bash
   pip install -r requirements.txt
   ```

4. **Run the application:**
   - **Web Interface:**
     ```bash
     streamlit run app.py
     ```
   - **Real-time Webcam Window:**
     ```bash
     python live_run.py
     ```

1. **Sidebar** β€” choose detection mode and tune parameters (threshold, min area, confidence).
2. **Video Upload tab** β€” upload a video, click **Process Video**, watch the live preview, then download the result.
3. **Webcam Snapshot tab** β€” take a photo from your webcam and see the detected landmarks / motion overlay.

## Project Structure

```
motion_detector/
β”œβ”€β”€ app.py              # Streamlit UI
β”œβ”€β”€ detector.py         # Core MovementDetector class
β”œβ”€β”€ requirements.txt    # Python dependencies
└── README.md           # This file
```

## Requirements

- Python 3.10+
- A webcam (for the snapshot tab)