Skip to content

Lightweight Python application for sorting images in your dataset

License

Notifications You must be signed in to change notification settings

2320sharon/Sniffer

Repository files navigation

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