/Sniffer

Lightweight Python application for sorting images in your dataset

Primary LanguageJupyter NotebookMIT LicenseMIT

Sniffer ๐Ÿ•

Python 3.6 Python 3.7
Action Badge
"Sniff out the good and bad imagery in your dataset."
Sniffer Logo



  • A python application for sorting through imagery.
  • Only sorts jpgs in the images directory
  • Saves the sorted jpgs in two directories called good_images and bad_images within the program's directory when File Mode is activated
  • Saves the outputs as a csv into the programs current working directory when CSV Mode is activated

Running the Program ๐Ÿ’ป

  • There are two ways to run the program, from the command line or from within a jupyter notebook.

Jupyter Notebook Method ๐Ÿช

  1. conda activate Sniffer
  2. cd <location where you saved Sniffer>
  3. jupyter notebook

Command Prompt Method

  1. conda activate Sniffer
  2. cd <location where you saved Sniffer>
  3. panel serve Sniffer.ipynb
  4. Copy the local host text into your browser of choice http://localhost:5006/Sniffer

sniffer_usage_example_v2

How to Use Hotkeys โŒจ๏ธ

I recommend using hotkeys in the localhost version of Sniffer. Sometimes jupyter notebooks will create and delete cells when you type a and d. That being said hotkeys will still work in jupyter notebook.

Sniffer's Hotkeys

a = good image
d = bad image
s = undo last action

Installation Guide & Updating ๐Ÿงฐ

Download Sniffer โฌ

  1. Clone the repository

git clone --depth 1 https://github.com/2320sharon/Sniffer.git

(--depth 1 means "give me only the present code, not the whole history of git commits" - this saves disk space, and time)

Install Sniffer ๐Ÿงฐ

  1. conda env create --file install/sniffer.yml
  2. conda activate Sniffer

Update Sniffer โซ

  1. cd <location where you installed Sniffer>
  2. cd install
  3. conda activate sniffer
  4. conda env update --file sniffer.yml --prune

Directory Structure

โ”œโ”€โ”€ Sniffer
โ”‚   โ”œโ”€โ”€ Sniffer
โ”‚   โ”‚   โ”œโ”€โ”€ tests                       #Don't touch the test directory
|   |   |  |_ test_data
|   |   |_ __init__.py
|   |   |_ conftest.py
|   |   |_ test_sniffer.py
|   | 
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ sniffer.py
โ”‚   
โ”œโ”€โ”€ install
|    |_sniffer.yml
โ”œโ”€โ”€thumbnails
|    |_ <OTHER THUMBNAILS GENERATED BY SNIFFER>
|
|___images
|    |_ <YOUR IMAGES HERE>
|
|___good_images
|    |_ <GOOD IMAGES MOVED HERE BY SNIFFER>
|
|___BAD_images
|    |_ <BAD IMAGES MOVED HERE BY SNIFFER>
|
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ assests
โ”œโ”€โ”€ .github
โ””โ”€โ”€ .gitignore

Quick Disclaimer

Currently sniffer only works with images with the .jpg extension. Other file types are not supported.

Unsupported File Types

  • โŒ .PNG

๐Ÿ˜ฎ Updates Coming Soon ๐Ÿ˜ฎ

  1. Support for .pngs
  2. Hosting ๐ŸŒ
  3. A wiki full of examples and troubleshooting tips