MIT License

项目介绍

soruly/trace.moe 是一个托管在 GitHub 上的开源项目,采用 MIT License 许可证,目前获得 5.0k 个 Star、258 次 Fork。

仓库全名
soruly/trace.moe
开源许可证
MIT License
Star 数
5.0k
Fork 数
258

README 摘要

trace.moe 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: trace.moe API For Bots/Apps, refer to https://soruly.github.io/trace.moe-api/ System Overview This repo is…

完整内容见 GitHub 原始 README 或本页 。

常见问题

trace.moe 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 trace.moe 的源码?

可以直接克隆仓库:git clone https://github.com/soruly/trace.moe.git,默认分支为 master;安装与运行步骤见仓库 README。

trace.moe 最近还在维护吗?

仓库最近一次更新为 9月24日,当前没有未关闭的 Issue;Star 数为 5.0k,可作为社区活跃度的参考。

关于

GitHub 原始描述(英文)

Timestamp Retrieval for Anime Clips Everywhere

描述取自 GitHub 官方 API,保持仓库作者书写的原文。

简要分析

热度分
5653
价值分
3113
活跃状态
活跃

README

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:

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
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. Create directory /mnt/c/trace.moe/video/

  2. Create subdirectory using anilist ID as folder name.

  3. Put video files in it. The full path should look like this /mnt/c/trace.moe/video/{anilist_ID}/foo.mp4

  4. Copy .env.example to .env and set VIDEO_PATH to /mnt/c/trace.moe/video/

  5. Start the containers docker compose up -d

It will scan the VIDEO_PATH every minute for new video files (.mp4 .mkv .webm files only, others are ignored).

You can check the indexing process the from logs of api server

  1. Open http://localhost:3000 and start searching

More configurations

Other configurations like port mapping are defined in compose.yml

You can also increase MAX_WORKER to make hashing faster.

Using pre-hashed data

Loading all 114,514 files to memory requires about 140GB RAM

  1. Download the database dump.sql.zst on https://huggingface.co/datasets/soruly/trace.moe-database-dump

  2. Install zstd

sudo apt install zstd   # Ubuntu / Debian
sudo yum install zstd   # CentOS / RHEL
sudo dnf install zstd   # Fedora
sudo pacman -S zstd     # Arch Linux
  1. Start all containers
docker compose up -d
  1. Load the database dump to postgres
docker exec -i tracemoe-postgres-1 psql -U postgres postgres < <(zstdcat dump.sql.zst)

This process takes a few minutes. You can ignore all errors like ERROR: relation "xxx" already exists.

  1. Load all hashes to Milvus
docker exec -i tracemoe-postgres-1 psql -U postgres postgres < <(echo "UPDATE files SET loaded=NULL")

This process may take 24 hours. You can check the progress by

docker exec -i tracemoe-postgres-1 psql -U postgres postgres < <(echo "SELECT status, COUNT(*) FROM files GROUP BY status")

Once all files are LOADED, it’s ready for search. But background optimization in Milvus may take a few days to complete.

How to cleanup everything

To remove all docker containers and delete all database volumes:

docker compose down -v

Finally, manually clean up the VIDEO_PATH directory if you need to.

评论

暂无评论