8
$\begingroup$

I have a large number of images that I need to classify for training a clustering algorithm, and I would like to do so offline (the data is proprietary). Basically, I'd like to build a desktop survey tool that enables me to rapidly place each image into one or two categories. Ideally, the tool would:

  1. Search in a pre-specified desktop folder for an image;
  2. Display the image and a static list of categories, allowing me to click on one;
  3. Upon clicking, record the category associated with the image;
  4. Store the image filename and associated category in a dataset somewhere;
  5. Display the next untagged image in the folder and repeat the process.

Is there an easy way to build this kind of tool in Python, or some other pre-built utility that I could use for free offline?

$\endgroup$
3
  • $\begingroup$ did you end up writing a tool you'd be willing to share? or did you find anything else? $\endgroup$ – jlarsch Sep 16 '16 at 14:32
  • 2
    $\begingroup$ There a few tools out there for image annotation, the most popular and easy to use one is: github.com/tzutalin/labelImg $\endgroup$ – olive_tree Aug 4 '17 at 17:34
  • $\begingroup$ One other option that people have recommended is Pybossa...I did write a tool with Flask, but it was very clunky to set up and is not great. At some point I will clean up the code and post the repo, but I don't recommend it at this moment. $\endgroup$ – atkat12 Apr 6 '18 at 21:44
3
$\begingroup$

I have created a code fulfilling the 5 requirements you have, it is available on GitHub as image-sorter2. Compared to the other suggested scripts here image-sorter2 is 100% free of charges and you don't need to spend time on drawing bounding boxes - the script simply opens a GUI for you, you click on one of multiple buttons and correspondingly each image is sorted into the desired class-folder, e.g. "cats", "dogs", "trucks" a.s.o.

enter image description here

$\endgroup$
2
  • $\begingroup$ I am switching the endorsement to this answer because it is a free, simple app that is quick to get up and running, and easily customizable. On the Github readme there is also a nice list of alternative options. I just revisited this task today and I found this option to work well...if you are doing something more sophisticated (like annotating parts of the image) then other answers might work better. $\endgroup$ – atkat12 Nov 18 '19 at 15:35
  • 1
    $\begingroup$ @atkat12 I am happy to see you find the code helpful, even though published years after your post. I hope it will help other users, too, so thanks for endorsing! $\endgroup$ – NeStack Dec 2 '19 at 14:36
3
$\begingroup$

I would recommend building your own database-backed Web app, since you have proprietary data and few (only two?) classes. I would create tables for the images, users, and labels.

user: (id, name)
image: (id, url)
label: (user.id, image.id, time, class)

The label class can be an enum. If you don't want to let users rate the same image multiple times you can drop the time column, and set the first two ID columns as the compound primary key.

If you've never dealt with Web applications and databases it will seem complicated, but it is easy once you get the hang of it. Here is a tutorial. The benefit of this approach is persistence; you can turn off your computer and the start where you left off thanks to the database.

A simpler alternative is to collect all your data in one session using GUI components such as ipywidgets for jupyter, and writing the labels to a file. With this approach you do not get persistence.

$\endgroup$
1
  • $\begingroup$ Tutorial looks great and I didn't know about iPyWidgets. Thanks for providing multiple options! $\endgroup$ – atkat12 Aug 10 '16 at 16:20
3
$\begingroup$

One great online service is Dataturks. Super streamlined UX and easy to use. Also supports your private data on our internal cloud.

enter image description here

Also supports, polygons, segmentation etc.

enter image description here

Here is a demo you can try (with no signup required):

Demo Image Classification

P.S: Since browsers are not allowed to access files on your local disk directly, you might need to run a dummy web server to get local URLs to files.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.