soruly / trace.moe

Anime Scene Search by Image
https://trace.moe
MIT License
4.53k stars 233 forks source link
anime cbir image-retrieval image-search lire opencv solr visual-search

trace.moe

License Discord

Anime Scene Search Engine

Trace back the scene where an anime screenshots is taken from.

It tells you which anime, which episode, and the exact moment this scene appears.

Try this image yourself.

Web Integrations

Link to trace.moe from other websites, you can pass image URL in query string like this:

https://trace.moe/?url=https://images.plurk.com/32B15UXxymfSMwKGTObY5e.jpg

trace.moe API

For Bots/Apps, refer to https://soruly.github.io/trace.moe-api/

System Overview

This repo is just an index page for the whole trace.moe system. It consists of different parts as below:

Client-side:

Server-side:

Others:

Hosting your own trace.moe system

You're going to need these docker images. They are provided in the compose.yml file.

Parts Docker CI Build Docker Image
liresolr GitHub Workflow Status Docker Image Size
trace.moe-www GitHub Workflow Status Docker Image Size
trace.moe-api GitHub Workflow Status Docker Image Size

Prerequisites

You need docker compose for your OS. Windows is supported via WSL2.

Getting started

  1. Copy .env.example to .env and update config as you need.

  2. Ensure the directories exist before starting the containers. The SOLR_DIR, must have it's owner uid and gid set to 8983.

mkdir -p /mnt/c/trace.moe/video/
mkdir -p /mnt/c/trace.moe/hash/
mkdir -p /mnt/c/trace.moe/sqlite/
mkdir -p /mnt/c/trace.moe/solr/
sudo chown 8983:8983 /mnt/c/trace.moe/solr/
  1. Start the cluster
docker compose up

How to begin hashing

trace.moe-api will scan the VIDEO_PATH every minute for new video files (.mp4 or .mkv). You can manually trigger a scan by calling /scan at the api server

curl http://localhost:3311/scan

Any video format readable by ffmpeg is supported. But the file extension must be either .mp4 or .mkv, other files will be ignored.

Folder structure for anilist ID

trace.moe assumes the folder name is anilist ID. If your data is not related to anilist ID, you can use any id/text you want. The system would still work partially without anilist data. The files must be contained in 1-level folders, e.g.

/mnt/c/trace.moe/video/{anilist_ID}/foo.mp4