asmindev / trace-scene

Find the Korean drama scene just with screenshot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KD Trace

Find the korean drama just with screenshot

Authors

How does this work?

The video is split into frames (in my case, I split 2 frames/second), then the frames are saved as a vector/matrix and the default model used is the resnet-18.

Run Locally

Clone the project and highly recommended to make a virtual enviroment

  git clone https://github.com/asmindev/trace-scene

Go to the project directory

  cd trace-scene

Install dependencies

  pip install -r requirements

Adding video to database follow this instruction

Start the server

  python3 app.py

Testing

  curl -X POST -F "file=@path/to/your/file.jpg" http://localhost:5000/search

Add Series

Folder videos structure

videos
│ ├── Series-name-1
│ │ ├── 001.mp4 # eps 1
│ │ └── 002.mp4 # eps 2
│ │
│ ├── Series-name-2
│ │ ├── 001.mp4
│ │ ├── 002.mp4
│ │ └── 002.mp4
│ │
│ ├── Series-name-3
│ │ ├── 001.mp4
│ │ └── 002.mp4
│ │
│ └── Series-name-4
│ ├── 001.mp4
│ ├── 002.mp4
│ └── 002.mp4
│
├── bulk_split_video.py
├── add_to_database.py
└── app.py

Splitting video and save to pickle

python3 bulk_split_video.py

Add pickle to vector database

python3 add_to_database.py

Tech Stack

Server: Flask

Database: Chromadb

Machine Learning: pytorch, img2vec

About

Find the Korean drama scene just with screenshot


Languages

Language:Python 100.0%