-
Notifications
You must be signed in to change notification settings - Fork 380
Add feature/conveyor application barcode #758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments, mainly on the structure
@@ -0,0 +1,106 @@ | |||
# Conveyor Application - Barcode Detection | |||
|
|||
This example demonstrates how to detect and decode barcodes in real-time using computer vision. The application is designed for conveyor belt applications where barcodes need to be detected and decoded from video streams. It uses a [barcode detection model](https://models.luxonis.com/luxonis/barcode-detection/768x576) for detecting barcode regions and combines multiple decoding strategies (pyzbar and zxing-cpp) to ensure robust barcode recognition across various formats and conditions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link not working, should be: https://models.luxonis.com/luxonis/barcode-detection/75edea0f-79c9-4091-a48c-f81424b3ccab
|
||
## Demo | ||
|
||
 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: The stream is very purpleish. Is this because of GIF compression or camera lens? Can we re-record with more true-to-life colors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we lower the size of the GIF to be <10Mb (lower is better)? Maybe reduce width and height and use more compresion? Check out https://ezgif.com/ tool for this
|
||
**Ubuntu:** | ||
```bash | ||
sudo apt-get update && apt-get install -y python3-pip libglib2.0-0 libgl1-mesa-glx wget git libzbar0 libzbar-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of these can be left out IMO like python, git, wget (is this one even needed)? For this specific example I feel like only zbar needs to be installed right? Let's maybe link to some installation guide for the speicfic library that we need
(same comment for macOS)
|
||
This will run the example with default arguments. | ||
|
||
Open visualizer on browser: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part can be left our, its already printed in the console
import os | ||
from datetime import datetime | ||
|
||
from utils.host_crop_config_creator import CropConfigsCreator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick on the imports structure: Let's first have imports from other packages (e.g. os, time, etc.), then depthai and then imports from utils. Check out other examples for the format
Same comment for imports in other files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, lets pin thins down to specific versions. For numpy and opencv-python check out other examples, for QR decoding libs let's pin it down at least to major version and for Pillow let's look into removing the dependency
formatter_class=argparse.ArgumentDefaultsHelpFormatter | ||
) | ||
|
||
parser.add_argument( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong. We don't need to expose --model parameter for this example as it works with one specific model
break | ||
|
||
if not barcodes: | ||
inverted = ImageOps.invert(pil_img) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we replace this with some transpose on numpy array?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this was generated by LLM (😉) but let's remove some of the comments that are self explanatory and some of the extra newlines as it just adds to the length of the file for now benefit
Purpose
An example of decoding barcodes on conveyor applications
Specification
new folder in object detection
Dependencies & Potential Impact
None
Deployment Plan
not applicable
Testing & Validation
None / not applicable