Skip to content

artstreltsov/pyimannotate

Repository files navigation

pyimannotate

pyimannotate2 is an enhanced version of pyimannotate

Overview of features

Features overview

What is this tool for?

pyimannotate is a Python-scripted Qt application tailored for hassle-free annotations of objects in images. Built on QGraphics architecture, it provides a smooth annotation experience to researchers aiming to mark locations of objects of interest. It supports input of all basic image formats (.png, .jpg, .bmp, .tif) or a label file in .json and outputs a .json file containing coordinates of objects, object types, respective label classes, image size and a compressed copy of the image in bytes (optinal, default=False, checkable in the 'File' tab), among others, plus a .csv workbook featuring the above.

** Note: Readme and the annotation tool itself are still under construction **

Dependencies (Tested Version in Parenthesis):

  • Python 3.x (3.6)
  • PyQt5 (5.9.1, pip install pyqt5)
  • Pandas (0.20.3)
  • the following basic python modules: functools, base64, json, re, os.

Hotkeys:

  • E: enable drawing mode
  • M: moving mode (move vertices, shapes)
  • N: navigation mode (pan mode)
  • C: complete current annotation object (if a non-closed shape is sought, i.e. line or point)
  • Del: delete selected/highlighted shape
  • Ctrl+O: open an image
  • Ctrl+S: save your annotations
  • Ctrl+G: select pointing line color
  • Ctrl+H: select shape color for the active class
  • Ctrl+Q: close the application
  • I: Initialize (or edit the list of) labels
  • L: Set line width of all objects (retrospectively)
  • [: Set attraction epsilon (attracts cursor to shape's first point if epsilon close)
  • ]: Save original image bytes (check option)

The examples folder contains a sample satellite image (of Duke University) and an annotated .json output.

Here is a picture of Duke University Cameron Stadium annotated: Cameron

Utilities:

  • object_extractor.py parses .json outputs and creates .csv workbooks with coordinates and types of objects (now built into pyimannotate). Tool for those more comfortable operating with .csv files rather then parsing .json files themselves.

  • binarymask.py creates binary masks from .csv workbooks, saves matrices in numpy .npz format. Tool for researchers in machine learning able to create ground truth (i.e. labels) for binary image classification problems.

  • imcropper.py crops the image on mouse click in rectangles with the cursor being the center of the rectangle and saves images of specified size (parameter IMSIZE) in the same folder as the original folder. Tool for researchers in machine learning able to crop big images to process the areas of interest.

References (related tools that influenced development)

Developed by Artem Streltsov of the Duke University Energy Initiative: https://energy.duke.edu/

Suggested citation: Artem Streltsov, Pyimannotate, (2018), GitHub repository, https://github.com/astr93/pyimannotate

LICENSE

About

Python image annotation tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages