Giter VIP home page Giter VIP logo

shotit-api's Introduction

Shotit logo


Version Shotit-api Shotit-media Shotit-worker Shotit-sorter


Shotit โšก

Shotit is a screenshot-to-video search engine tailored for TV & Film, blazing-fast and compute-efficient.

Shotit DEMO

Quick Start ๐Ÿš€

Docker Compose is required, Please install it first.

Minimum workload: 2v16G, 4v32G preferred.

git clone https://github.com/shotit/shotit.git
cd shotit
  • Copy .env.example to .env
  • Edit .env as appropriate for your setup, as is for the first time.
  • Copy milvus.yaml.example to milvus.yaml
  • Edit milvus.yaml as appropriate for your setup, as is for the first time.

Create these necessary folders.

mkdir -p volumes/shotit-hash
mkdir -p volumes/shotit-incoming
mkdir -p volumes/shotit-media
mkdir -p volumes/mycores
mkdir -p volumes/mysql

Set the user and group information of mycores to 8983, required by liresolr.

sudo chown 8983:8983 volumes/mycores

Then, up docker-compose services.

(Windows or Mac):
docker compose up -d
(Linux):
docker-compose up -d

PS: The docker-compose.yml file fetches docker images from GitHub. If you prefer dockerhub, use the following commands instead.

(Windows or Mac):
docker compose -f docker-hub-compose.yml up -d
(Linux):
docker-compose -f docker-hub-compose.yml up -d

Once the cluster is ready, you can add your video files to the incoming folder. Take Blender's Big Buck Bunny as an example, whose imdb tag is tt1254207, the path should be:

./volumes/shotit-incoming/tt1254207/Big_Buck_Bunny.mp4

Restart shotit-worker-watcher, in case it doesn't catch the change of your files.

docker restart shotit-worker-watcher

When shotit-worker-watcher detects the existence of video files in the incoming folder, it would start uploading the videos to object-storage powered shotit-media. After the upload, the videos would be eliminated, then shotit-worker-hasher creates hash and shotit-worker-loader loads the hash to vector database. Use the following command to see whether the index process has been completed:

docker logs -f -n 100 shotit-worker-loader

When the index process completes, you will notice a Loaded tt1254207/Big_Buck_Bunny.mp4 log and you can search the videos by screenshot directly from the URL below.

GET http://127.0.0.1:3311/search?url=https://i.ibb.co/KGwVkqy/big-buck-bunny-10.png

Response:

{
    "frameCount": 0,
    "error": "",
    "result": [
        {
            "imdb": "tt1254207",
            "filename": "Big_Buck_Bunny.mp4",
            "episode": null,
            "duration": 596.4169921875,
            "from": 473.75,
            "to": 479.17,
            "similarity": 0.9992420673370361,
            "video": "http://127.0.0.1:3312/video/tt1254207/Big%20Buck%20Bunny.mp4?t=476.46000000000004&now=1682985600&token=kc64vEWHPMsvu54Fpl1BrR7wz8",
            "image": "http://127.0.0.1:3312/image/tt1254207/Big%20Buck%20Bunny.mp4.jpg?t=476.46000000000004&now=1682985600&token=K0qxDPHhoviiexOyEvS9qHRim4"
        }
    ]
}

Congratulations! You have successfully deployed your shotit search engine.

Notice: the first time of api call should be longer since shotit has to load hash completely into RAM first.

Documentation ๐Ÿ“–

Please see here for full documentation on:

  • Getting started (installation, hands-on demo guide, cloud-native S3 configuration)
  • Reference (full API docs, limitation)
  • Resources (explanation of core concepts)

Architecture โ›ช

In a nutshell

Shotit is composed of these docker images.

Docker Image Docker CI Build Image Size
shotit-api GitHub Workflow Status Docker Image Size
shotit-media GitHub Workflow Status Docker Image Size
shotit-worker-watcher GitHub Workflow Status Docker Image Size
shotit-worker-hasher GitHub Workflow Status Docker Image Size
shotit-worker-loader GitHub Workflow Status Docker Image Size
shotit-worker-searcher GitHub Workflow Status Docker Image Size
shotit-sorter GitHub Workflow Status Docker Image Size
liresolr Docker Image Size
minio Docker Image Size
etcd Docker Image Size
mariadb Docker Image Size
adminer Docker Image Size
redis Docker Image Size
milvus-standalone Docker Image Size

Go deeper

Shotit architecture

Deep dive

Shotit deep architecture

Benchmarks

Dataset Episode number Vector volume Search time
Blender Open Movie 15 55,677 within 5s
Proprietary genre dataset 3,734 53,339,309 within 5s

Live Demo

https://shotit.github.io/shotit-frontend/demo

Acknowledgment

Shotit significantly adopts its system design pattern from trace.moe. The vision of Shotit is to make screenshot-to-video search engine genre-neutral, ease-of-use, compute-efficient and blazing-fast.

Contribution

See Contributing Guide.

License

Apache-2.0

shotit-api's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar leslie-wong-h avatar peachytree avatar soruly avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Forkers

hadryan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.