Code Monkey home page Code Monkey logo

cleanax's Introduction

Cleanax ๐Ÿงน

Zero-configuration dataset cleaner. Automatically detect solid color images and let the user delete them.

An image is completely red? ๐ŸŽ DELETE IT

An image is completely yellow? ๐ŸŒ DELETE IT

An image is a scenery? ๐ŸŽ‘ KEEP IT

Purpose

I spent a lot of time trying to extract a bunch of images from anime series (a frame each 8 seconds for example), but I encounter a series of problem... First, some images are completely black, completely white or duplicated. After some research over the internet, the reality is sad :/ There isn't a proper and efficient way to delete such annoying images. That's why I decided to create cleanax. The automated and fast way to automatically flag noise from a visual dataset.

Features

  • Flag solid color images
  • Flag corrupted image or non-image file
  • Flag duplicated images

Features are demonstrated with the tests folder. The following images are flagged as noise:

  • 48971.png
  • 54987.png
  • 62410.png
  • 70864.png

Performance

Not gonna lie, it's surprisingly fast:

Benchmark is run on the tests folder containing 11 images of size 1920 * 1080. The opencv piece of code simply checks wether images are completely black and this method may be sub-optimized.cleanax still offer an easier way to achieve dataset cleaning. (Performance are often I/O bound. Reading from an old hdd will be slower than reading from a new ssd.)

Usage

cleanax targets ease-of-use and thus, is distributed as a python package (undergoing deploiement on https://pypi.org/).

pip install cleanax
import os
import cleanax

# Files name flagged as noise
to_delete = cleanax.clean("path/to/img/")

# Delete them
for f in to_delete:
    os.remove("path/to/img/" + f)

Compiling

You may want to use the latest version of cleanax possible.

git clone https://github.com/vinhig/cleanax
cd cleanax
cargo build --release
cp target/release/libcleanax.so ./cleanax.so

You can import this library the same way as any other python file:

import cleanax

Warranty

cleanax is not meant to be a "high-quality software with a high liability", but rather a tool I heavily use myself during the composition of my datasets.

cleanax's People

Contributors

vinhig avatar

Watchers

James Cloos avatar  avatar

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.