Classi-Cine is a Rust-based tool that utilizes a Naive Bayes classifier for filename-based video tagging. It offers a user-directed classification approach by interacting with VLC's playback states via its http interface.
The first iteration of this tool is being used to help find and tag videos for deletion based on learned features (words, tokens, ngrams) in the video filepaths. The tag names "keep" and "delete" are arbitrary and can be overridden. For example, you could use this as a video recommendation engine for local video files. Stopping playback will train and recommend other similar video files.
- Interactive Training: Pause (Shortcut: space) to tag a video as "keep" or stop (Shortcut: s) to tag it as "delete".
- Dynamic Re-ranking: The classifier updates and re-ranks videos based on user input.
- Customizable Tags: The "keep" and "delete" tags can be customized, making this tool versatile for different applications.
VLC is required for video playback.
Ensure you have Rust and Cargo installed. If not, you can install them using rustup.
# Build from the cargo.io crate registry.
$ cargo install classi-cine
# Clone this repository
$ git clone https://github.com/mason-larobina/classi-cine.git
# Go into the repository
$ cd classi-cine
# Build and install it locally
$ cargo install --path=.
Usage: classi-cine [OPTIONS] <PATHS>...
Arguments:
<PATHS>...
Options:
--tokenize <TOKENIZE>
The tokenizer to use [default: chars] [possible values: words, chars]
--windows <WINDOWS>
Create ngrams (windows of tokens) from 1 to N [default: 20]
--delete <DELETE>
The text file containing the files to delete [default: delete.txt]
--keep <KEEP>
The text file containing the files to keep [default: keep.txt]
--log-level <LOG_LEVEL>
[default: info]
-f, --fullscreen
Fullscreen VLC playback
--file-size-log-base <FILE_SIZE_LOG_BASE>
The log base for the file size which is mixed into the classifier score to preference larger files over smaller files. Recommended values are close to 1.0, for example 1.1, 1.01, 1.001, and so on
--vlc-port <VLC_PORT>
[default: 9010]
--video-exts <VIDEO_EXTS>
[default: avi,flv,mov,f4v,flv,m2ts,m4v,mkv,mpg,webm,wmv,mp4]
-h, --help
Print help
- Discover Video Files: Locates all video files within the given directories.
- Tokenization: Words in the video file paths are tokenized and post-processed to handle unique and common tokens.
- Initialize Classifier: Loads previous tag states from file lists into the classifier.
- Re-ranking: Determines the next untagged video files to process ranked by most likely to be tagged based on the features in the video filepath.
- Interact with VLC: Launches VLC with the http interface.
- User Feedback Loop: The classifier and video ranking adapt based on whether playback is paused or stopped to train the classifier, re-rank and open the next likely video for tagging.
We're open to contributions! Enhancements, bug fixes, documentation improvements, and more are all welcome.
This project is licensed under the MIT License. See LICENSE for details.
Made with ❤️ and Rust.