Git Product home page Git Product logo

planogram-detection's Introduction

Planogram-detection

The code has not been shared due to company's privacy policy. Access might be granted on request.

Detection of objects in store shelf. This repository consists of 3 different approaches : Selective Search, Watershed and Deep Learning Selective requires no. of possible boxes as input. Watershed seems to be working good unsupervised. More test results need to be seen. Deep Learning approaches available on google drive in form of Android App

Usage

  • Previosuly generated code is in watershed/allcodes.py
  • Final code for Honeywell Hackathon is present in final_count_code.ipynb

Results

Kmeans approach:

K-means for unsupervised clusture segmentation has been applied using OpenCV, pandas, Scikit Learn. This requires a input feed of value of k (around 6 works fine as per experiments on given images) and segments those prominent regions. The major drawback of these method is that the region selection does not take into account the chances of similar object in different clusters. Also, value of k is higly subjective to the image. Additionally, this method does not take into account the similarity between two objects and focuses more on region segmentation rather than grouping. For further improvement, this method can be clubbed with vaious matching methods to intelligently form groups (I tried it later and would cover that up in this description)

Selective Search:

A promising method but the problem still remains the same that rather than grouping, this method focuses on forming bounding boxes and segmenting the image. This segmentation cannot be classified into good matches/regions and bad regions. Most of the time multiple regions form over single set of objects and while minimizing the segment count they become prominent ones. For further improvement, a maximum segment percent might be set for eliminating any box with more than that overlap. But this also arises one more question of which block to keep. Second approach could be to use deep learning (just like YOLO) to classify it as a good/bad match and shift and resize the box accordingly.

Watershed:

Best results with OpenCV recieved so far without using Deep Learning. Watershed does laplacian distance tranform on images to seperate the dis-joint parts. This method yields each object as an independent box to us so we have a unique ID for each object onto the image. These objects are then matched up with each other using template matching with 95% acuracy to give regions of similar object. This in true sense is grouping and not segmentation. Problems faced by this method is:

  1. If object is black color, it cannot segment it out as watershed method assumes black to be the background color.
  2. Sometimes object looks so dissimilar that 95% match criteria is too high to satisf by reducing the threshold gives false positive results.

For further improvement, different matching module could be used (including DL), or even 95% would do as those false negative cases might be rejected and bounding boxes can be formed using only true positive results.

YOLO/MobileNet/other DL approaches:

DL approaches significantly varies between laptop and mobile performance so prefer testing on mobile only. All the apps/ methods made/modified by me uses google's code/models to test and are not trained for our specific object type. This is a major drawback to test the model as it gives results on basis of pretrained dataset. Based on my experimentation, MobileNet works best in comparison to all. There is some part of android (java file) error till where I left. For further improvement, try to train MobileNet on our dataset to see if it is improving any part of our result. Later on another method struck me after a while to use Siammese Network as a template matcher in our OpenCV approach. Further more, rather than relying on puely DL approach, OpenCV result after watershed all object segmentation can be used as a feed to the network.

Distance Measurement:

Firstly dimensions to pixel relation is estabilished at a known distance in X and Y direction using a pre-measured reference tag. These reference readings are store and used for further calculations. Now any width and height can be known using the estabilished relation. For measing this relation, HSV thresholding was done to segment out the uniquely coloured tag to seperate it out from the image.

Links

Android Apps:

https://drive.google.com/drive/folders/1UFFbn6HY03-7SqWYJN7Tg9ubnpZb6zc2?usp=sharing https://drive.google.com/drive/folders/1vYzk0HKjZ4_Ine5MFPsG5xw-Wp8WGLhb?usp=sharing

All test and result images: https://drive.google.com/drive/folders/1dKwiTsm3-hzt_xfM9BVWXIBqPS0pZM1m?usp=sharing

Image credits: See image urls file.

planogram-detection's People

Contributors

ritvik03 avatar

planogram-detection's Issues

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.