Skip to content
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

Gen2 license plate example #94

Merged
merged 12 commits into from
Mar 17, 2021
Merged

Gen2 license plate example #94

merged 12 commits into from
Mar 17, 2021

Conversation

VanDavv
Copy link
Contributor

@VanDavv VanDavv commented Mar 14, 2021

Gen2 License Plates Recognition

This example demonstrates how to run 2 stage inference on DepthAI using Gen2 Pipeline Builder.
First, a license plate is detected on the image and then the cropped license frame is sent to text detection network,
which tries to decode the license plates texts

⚠️ This demo is adjusted to detect and recognize chinese license plates! It may not work with other license plates

Demo

Gen2 License Plates recognition

@VanDavv
Copy link
Contributor Author

VanDavv commented Mar 15, 2021

This PR is now ready to merge IMO.
It has license plate detection + recognition + car attribute estimator.

I've noticed though that vehicle-license-plate-detection-barrier-0106 has a poor performance in terms of detecting the cars - so I've added a new network - vehicle_detection_adas_0002 - that is detecting the cars way better and is later on feeding these results to car attributes network.
This however decreases the overall performance of the example, that's why I didn't add it to this PR and pushed to a separate branch instead - gen2_license_plate_example_separate_veh_nn

What are your thoughts about using this additional nn to detect cars and therefore increase the amount of data produced by car attribute estimator? Is it worth the slower performance?
CC @Luxonis-Brandon @themarpe @szabi-luxonis @wasauce @dhruvsheth-ai ?

@VanDavv VanDavv marked this pull request as ready for review March 15, 2021 17:01
@wasauce
Copy link
Contributor

wasauce commented Mar 15, 2021

First let me say this is AWESOME work and I am super excited to see it. Thank you @VanDavv .

One thought is maybe in the README it would be helpful to note that the license plate system is focused on Chinese license plate detection. I ran a test on my own video (garage, US license plates) and it was unable to detect license plates. I think this way -- by including in the README what people should expect with the demo -- that will help protect against questions about it not working -- when it does work great!

@VanDavv
Copy link
Contributor Author

VanDavv commented Mar 15, 2021

Thanks @wasauce , just added the mention

@Luxonis-Brandon
Copy link
Contributor

@VanDavv - can we default-use the license plate detector trained via reoboflow? And then mention that it was trained via roboflow, and that others can retrain for their region/state/nation using roboflow?

@wasauce
Copy link
Contributor

wasauce commented Mar 16, 2021

@Luxonis-Brandon ooh - the Roboflow one would be great -- so we can better understand how to use Roboflow to build a model :) I have a large collection of US license plate photos from http://vision.ucsd.edu/belongie-grp/research/carRec/car_data.html and I am interested in building a model via RoboFlow

@wasauce
Copy link
Contributor

wasauce commented Mar 16, 2021

@VanDavv - I tried this branch and I tried gen2_license_plate_example_separate_veh_nn

I think you should bring in all the changes/enchancements from gen2_license_plate_example_separate_veh_nn - the performance seemed sufficient and any degradation frankly not that noticeable.

A question -- in gen2_license_plate_example_separate_veh_nn - the attributes of the vehicles continued to be identified -- whereas this branch the attributes got "Stuck" after the white car and then stopped updating. I would use this as a second argument for why gen2_license_plate_example_separate_veh_nn is good!

@VanDavv
Copy link
Contributor Author

VanDavv commented Mar 16, 2021

Thanks @wasauce for the feedback, I agree and will merge these changes here

A question -- in gen2_license_plate_example_separate_veh_nn - the attributes of the vehicles continued to be identified -- whereas this branch the attributes got "Stuck" after the white car and then stopped updating

This is the issue I tried to solve with this additional branch. The vehicle-license-plate-detection-barrier-0106 is adjusted to the barrier scenario, so I guess it learned to detect the cars looking top to bottom, not facing directly - that's why it just doesn't produce confident-enough results and is filtered out by the confidence threshold.
I tried to lower the confidence threshold for the cars but at some point, it started to get too noisy.

* add a separane NN for vehicle detection

* Add chinese liense plates notice
Copy link
Contributor

@themarpe themarpe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename chineese_traffic.mp4 to chinese_traffic.mp4
Otherwise LGTM

@VanDavv VanDavv merged commit 4eb7200 into master Mar 17, 2021
@VanDavv VanDavv deleted the gen2_license_plate_example branch March 17, 2021 13:19
@wasauce
Copy link
Contributor

wasauce commented Mar 17, 2021

@Luxonis-Brandon - do you have any information you can share about what you wrote above: "default-use the license plate detector trained via roboflow" or information/documentation about how to roboflow and export a model for use with DepthAI?

@dhruvmsheth
Copy link
Contributor

dhruvmsheth commented Mar 17, 2021

Really neat @VanDavv , and everything works perfect! Thanks for making this.

Suggestion - Keeping vehicle-detection-adas threshold as 0.5 makes the classification really noisy, detecting pedestrians as trucks. An alternative could be increasing it to 0.75.

Also running video input argument appends the following error -

(python3:3945): GStreamer-CRITICAL **: 21:23:13.581: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed
[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (713) open OpenCV | GStreamer warning: Error opening bin: no source element for URI "/home/pi/depthai-experiments/gen2-license-plate-recognition/chinese-traffic.mp4"
[ WARN:0] global ../opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
Creating pipeline...
Creating License Plates Detection Neural Network...
Creating Vehicle Detection Neural Network...
Pipeline created.
Starting pipeline...
[14442C10318DE4D200] [7.296] [NeuralNetwork(8)] [warning] Network compiled for 4 shaves, maximum available 16, compiling for 8 shaves likely will yield in better performance
[14442C10318DE4D200] [7.297] [DetectionNetwork(0)] [warning] Network compiled for 4 shaves, maximum available 16, compiling for 8 shaves likely will yield in better performance
[14442C10318DE4D200] [7.298] [NeuralNetwork(12)] [warning] Network compiled for 4 shaves, maximum available 16, compiling for 8 shaves likely will yield in better performance
[14442C10318DE4D200] [7.299] [DetectionNetwork(4)] [warning] Network compiled for 4 shaves, maximum available 16, compiling for 8 shaves likely will yield in better performance
[14442C10318DE4D200] [7.315] [NeuralNetwork(8)] [warning] The issued warnings are orientative, based on optimal settings for a single network, if multiple networks are running in parallel the optimal settings may vary
FPS: -0.00

I'm not sure about this, could be a system error. Will go through the code once to check what's causing it. Thanks for your time!
The Amazing feature is that inspite of inferencing 4 models in sync, it runs at a high FPS, nearing 15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants