Code Monkey home page Code Monkey logo

sniffer's Introduction

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

sniffer's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sniffer's Issues

Non-square imagery and Panel App

non square imagery did not render at the correct aspect ratio on the panel app (Linux + Firefox).
It did work w/ correct aspect ratio on the Jupyter Notebook (but its harder to make the image larger on jupyter notebook b/c of margins of the notebook)

example image is provided, as well as screenshot of panel app and notebook

example image:
C21771409-2_a

Panel App:
image

Notebook:
image

And for completeness.. streamlit sniffer preserves the correct aspect ratio:
image

Beyond 'good' and 'bad' (enhancement)

How hard would it be to replace the yes/no buttons with other options (and perhaps beyond 2).. I am thinking of a Likert scale (1-5)?
I could see a few ways to do this:

  • a free text field, where people put a number?
  • a slider where people could rate images between 0 and 1?
  • multiple buttons (5 in this case, vs 2 in yes/no)?
  • radio buttons (which i guess is like the multiple button idea)?

Sniffer Doesn't Accept `JPEG`s

Sniffer Doesn't Accept JPEGs

Sniffer will convert .JPG to .jpg, but not .jpegs.
There needs to be a generic conversion function that converts any jpg type of image to the .jpg. The same function could be used for .pngs as well.

  • REGEX would be great to use to scan the file extensions for matches

Update ReadMe

The ReadMe doesn't have enough details about how to run and install Sniffer.

  1. Add more detailed installation instructions
  2. Mention that currently it only runs in localhost or in jupyter notebook
  3. How to create the anaconda environment
  4. Update the recording
  5. Update the roadmap

Display "number of images left to tag"

I like how there is a text display that increments to tell me how many images I have tagged. But I'd also like to know how many images I have left to do. The principal reason is because eventually I'd like there to be an optional button that would initiate model training to autocomplete the classification process. Without a "X images remaining" display, a user wouldn't easily gauge when to stop tagging and start model training and implementation

this is like "human in the loop" for binary (yes/no type) image classification.

Sniffer Doesn't Accept PNGs

Sniffer Doesn't Accept PNGs

Currently, Sniffer can only render .jpg files. Sniffer needs to be able to detect .png files and render a png panel if it finds them.

  1. Sniffer needs to detect .png files and render a png panel
  2. Sniffer needs to hide the jpg panel and show the png panel instead when a .png file is found
  3. Sniffer needs to convert file types .PNG to .png

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.