File size: 2,615 Bytes
d68704f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
---
title: Camera Movement Detector
emoji: "πŸ“·"
colorFrom: red
colorTo: pink
sdk: streamlit
sdk_version: "1.25.0"
app_file: app.py
pinned: false
---


# πŸ“· Camera Movement Detector

This project was developed as part of the **ATP Core Talent AI Coder Challenge 2025**.  
It is a Streamlit-based web application that analyzes uploaded videos and detects **significant camera movements** such as panning, tilting, or shaking.  
It does **not** focus on object motion β€” instead, it detects changes in the global scene indicating that the camera itself moved.

---

## πŸ“· Screenshot

![Camera Detector Screenshot](https://github.com/user-attachments/assets/90a2831b-2218-42a6-8172-f3ee63661157)

## πŸš€ Live App

πŸ”— [Click here to try the app online](https://your-deployment-url.com)  
(Replace this with your Streamlit or Hugging Face link after deployment)

---

## 🎯 Features

- πŸ“Ό Upload a video (MP4, AVI, MOV)
- 🎞️ Extracts and analyzes frames
- 🎯 Detects significant camera movement (not object motion)
- πŸ’‘ Clean, modern UI with ATP branding

---

## 🧠 Approach

- **Frame Extraction:** Extracts all frames from the video using OpenCV.
- **Feature Detection & Matching:** ORB feature detector is used to compare consecutive frames.
- **Homography Transformation:** Calculates transformation matrix to estimate global scene shift.
- **Movement Decision:** If the transformation deviates above a threshold, it is classified as camera movement.
- **Bonus Logic:** Tries to filter out object motion by comparing matched keypoints and transformation consistency.

---

## πŸ› οΈ Tech Stack

- **Python 3.13**
- **OpenCV**
- **Streamlit** (for UI)
- **Datasets** from Hugging Face (for CameraBench demo data)
- **NumPy** for numerical processing

---

## πŸ“¦ Installation

To run locally:

```bash
git clone https://github.com/yourusername/camera-detector.git
cd camera-detector
pip install -r requirements.txt
streamlit run app.py
```

## πŸ“ File Structure

```bash
camera-detector/
β”œβ”€β”€ app.py                 # Streamlit web UI
β”œβ”€β”€ movement_detector.py   # Core detection logic
β”œβ”€β”€ requirements.txt       # Dependencies
β”œβ”€β”€ README.md              # This file
```

### πŸ“Έ Example Output

Input: Sample video with camera shake

#### Output:

```bash

πŸ“Œ Detected camera movement at frame indices: [6, 7, 8, 10, 15, 22, 23, 24]
```
## πŸ’¬ Acknowledgements

* Hugging Face CameraBench Dataset
* ATP Core Talent Team for organizing the challenge

## πŸ§‘β€πŸ’» Developed by

* Saadet Elizaveta Babal
* Candidate – ATP Core Talent AI Coder Challenge 2025