Giter Site home page Giter Site logo

image-annotation's Introduction

Image annotation project

Simple test project: Django application with API for images and their annotations.

Running

  1. Install Docker
  2. Run docker-compose up from project directory
  3. Locally send API requests to http://localhost:8000 (no authentication required for simplicity)

API

  1. Create image: curl -v -F [email protected] -F annotation='{"labels": []}' http://localhost:8000/images/
  2. Update image annotation: curl -H 'Content-Type: application/json' -X PUT -d '{"annotation": {"labels": []}}' http://localhost:8000/images/8/
  3. Get image data (url and annotation): curl -X GET "http://localhost:8000/images/8/"
  4. Get image data in export format: curl -X GET "http://localhost:8000/images/8/?format=export"
  5. Get image url: curl -X GET "http://localhost:8000/images/8/url/"

Architecture

This project uses specific schema for image annotations (defined in images.schemas.IMAGE_ANNOTATION_SCHEMA). Main question during development was how to store this annotation.

We can use two different approaches: store everything as plain json or create separate tables for each entity in annotation.

Reasons to store annotation in json field:

  1. Annotations are self-contained (no links between images) and operated on the whole (document approach), not by specific labels (RDBMS approach).
  2. Annotations are relatively small (up to 100 labels) and all operations can be easily done in-memory by Python.
  3. No need for complex cross-image joins, aggregation or even gathering annotations for all images (e.g. for list view).
  4. Easy writing and updating.

Should project requirement change, database schema must be migrated to separate tables to store annotation.

Tests

  1. docker exec -it image-annotation_backend_1 bash
  2. python manage.py test

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.