Giter Club home page Giter Club logo

ml-youonlylookonce's Introduction

YOLO object detection

In this challenge you'll build a very simple implementation of object detection and localization. You'll build on the material you covered in the unit on convolutional neural networks, using pretrained CNNs from the Keras library and basic image manipulation. The project proceeds in three steps:

Step 1

Build a function contains_banana(img) that takes in an image img, resizes it to 224x224, and returns a float describing the confidence with which Keras believes the image contains a banana. Do this using the Keras pretrained ResNet50 architecture. If "banana" is in ResNet50's top-3 results for the image, report the corresponding reported probability. Otherwise, return 0.0. To test that this function works, you should apply it to the examples in the sample_data folder.

Step 2

Build a function crop_image(img, quadrant) that takes in an image img and a parameter ``quadrantin["TL", "TR", "BL", "BR"]` and returns the top left 2/3 x 2/3, the top left, the top right, the bottom left, or the bottom right, depending on the parameter value. To visualize this partitioning, imagine that we lay a tic tac toe board over the image. Then the TL partition corresponds to the roughly 67% of the image lying in the top-left-most four squares.

Step 3

Now combine the results of steps 1 and 2 to build the function find_banana(img). If the image argument doesn't contain a banana, the function should return the string None. If it does contain a banana, the function should return either "TL", "TR", "BL", "BR", or "C" (for "center") depending on whether one of the four partitions or the original image has the highest banana probability (according to ResNet50).

Stretch goals

The function crop_image should complain if the parameter quadrant isn't one of ["TL", "TR", "BL", "BR"]. Modify the function slightly so that it throws an appropriate error if an invalid quadrant is passed.

Write unit tests to make sure that contains_banana correctly finds that each image in sample_data/positive_examples contains a banana and each image in sample_data/negative_examples does not.

Other notes

For resources discussing "You Only Look Once" see:

For reference on ResNet50, see: https://www.pyimagesearch.com/2017/03/20/imagenet-vggnet-resnet-inception-xception-keras/

For example usage, see: https://keras.io/applications/

ml-youonlylookonce's People

Watchers

 avatar  avatar  avatar

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.