Skip to content

Instantly share code, notes, and snippets.

@davidvuong
Last active July 27, 2017 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save davidvuong/8da55f78016af67326dea7dc0e491a62 to your computer and use it in GitHub Desktop.
Save davidvuong/8da55f78016af67326dea7dc0e491a62 to your computer and use it in GitHub Desktop.
Image Intelligence TakeHomeTest

Image Intelligence TakeHome Assignment

Your task is to build an image processing service. A client may send one or many images to your service in the form of JSON. Your service makes an API call to a deep learning platform to detect classes in a set of images. Once the detection is complete, the client gets back a JSON object containing the classes and confidence values of each image sent. For example:

Request:

{
  "images": [
    "http://example.com/image1",
    "http://example.com/image2",
    "http://badurl.com/image3",
  ]
}

Success Response:

{
  "results": [
    {
      "url": "http://example.com/image1",
      "classes": [
        {
          "class": "person",
          "confidence": 0.8641
        },
        {
          "class": "dog",
          "confidence": 0.00516
        }
      ]
    },
    {
      "url": "http://example.com/image2",
      "classes": [
        {
          "class": "cat",
          "confidence": 0.2115
        }
      ]
    },
    {
      "url": "http://example.badurl.com/image3",
      "error": "Invalid URL"
    }
  ]
}

Note that the above is just an example. You have complete freedom in how you want to design your service interface, as long as the interface takes in JSON objects with the image URLs and returns the results for each image. You could implement it as a HTTP API, a queue worker or even as a CLI tool that talks to a daemon process!

As seen from the example response above, since errors do occur, such as invalid URLs, invalid image formats etc., your service needs to report the error to the user when one occurs. As the list of errors that may occur may potentially be large, feel free to handle only the most important errors you see fit.

You also have complete freedom around which deep learning platform you prefer to use (e.g., Caffe, Torch, TensorFlow, MXNet). However, rather than training your own model from scratch, we recommend you use a pre-trained model taken from a model zoo (e.g. Caffe Model Zoo).

The criteria we look for in this assignment are the following:

  1. How you structure your code, and
  2. API design, that is, how clients will interface with your deep learning service and how your service will respond to the clients.

Realistically this project will take you more than a couple of hours, it'll probably be a weekend worth of work. That said, you're free to spend more/less time.

Requirements

  1. Implement your solution in either Python or Scala
  2. Provide clear instructions on how to run and interface with your service
  3. Provide unit tests for code written in your application layer
  4. Documentation (and comments, if need be)
  5. Use of git as your VCS

Bonus Points

  1. Provide a way for us to set a confidence threshold (e.g., confidence values below 0.05 are not presented in the results)
  2. Your service is able to run on a GPU, fully parallelised, processing images in batch for efficiency

Submission

  1. Push your code reguarly to an upstream host (e.g. GitHub, Bitbucket) then send us a link to your repository

What we're looking for?

Treat it like production code. That is, develop your software in the same way that you would for any code that is intended to be deployed to production. These may be toy exercises, but we really would like to get an idea of how you build code on a day-to-day basis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment