ria-com / nomeroff-net

Nomeroff Net. Automatic numberplate recognition system.
GNU General Public License v3.0
457 stars 159 forks source link

draw rectangle bbox on plate #274

Open MyraBaba opened 1 year ago

MyraBaba commented 1 year ago

in the :

(images, images_bboxs, images_points, images_zones, region_ids, region_names, count_lines, confidences, texts) = unzip(number_plate_detection_and_reading([image_path]))

how I can draw the bbox over the plates ?

images_points has different format

ApelSYN commented 1 year ago

Check out this example: https://github.com/ria-com/nomeroff-net/blob/master/examples/ju/benchmark/accuracy-test.ipynb

This example uses the methods described in this file: https://github.com/ria-com/nomeroff-net/blob/master/nomeroff_net/pipelines/base.py

The code will be something like this:

                    image = image.astype(np.uint8)
                    for cntr in image_points:
                        cntr = np.array(cntr, dtype=np.int32)
                        cv2.drawContours(image, [cntr], -1, (0, 0, 255), 2)
                    for target_box in image_bboxs:
                        cv2.rectangle(image,
                                      (int(target_box[0]), int(target_box[1])),
                                      (int(target_box[2]), int(target_box[3])),
                                      (0, 255, 0),
                                      1)
                    plt.imshow(image)
                    plt.show()
MyraBaba commented 1 year ago

Sometime texts size is not the same bbox size.

What does it mean ? It means text can’t be recognized or low accuracy?

Thanks

On 6 Jun 2023, at 11:15, Oleg Cherniy @.***> wrote:

Check out this example: https://github.com/ria-com/nomeroff-net/blob/master/examples/ju/benchmark/accuracy-test.ipynb https://github.com/ria-com/nomeroff-net/blob/master/examples/ju/benchmark/accuracy-test.ipynb This example uses the methods described in this file: https://github.com/ria-com/nomeroff-net/blob/master/nomeroff_net/pipelines/base.py https://github.com/ria-com/nomeroff-net/blob/master/nomeroff_net/pipelines/base.py The code will be something like this:

                image = image.astype(np.uint8)
                for cntr in image_points:
                    cntr = np.array(cntr, dtype=np.int32)
                    cv2.drawContours(image, [cntr], -1, (0, 0, 255), 2)
                for target_box in image_bboxs:
                    cv2.rectangle(image,
                                  (int(target_box[0]), int(target_box[1])),
                                  (int(target_box[2]), int(target_box[3])),
                                  (0, 255, 0),
                                  1)
                plt.imshow(image)
                plt.show()

— Reply to this email directly, view it on GitHub https://github.com/ria-com/nomeroff-net/issues/274#issuecomment-1578154418, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEFRZH72NCHRRFZ6X43355DXJ3RL5ANCNFSM6AAAAAAY4ADO5U. You are receiving this because you authored the thread.

MyraBaba commented 1 year ago

Hi,

I saw the gpu utilization very low %7 .

How I can set the use gpu default or increase the usage of the gpu ?

On 6 Jun 2023, at 11:15, Oleg Cherniy @.***> wrote:

Check out this example: https://github.com/ria-com/nomeroff-net/blob/master/examples/ju/benchmark/accuracy-test.ipynb https://github.com/ria-com/nomeroff-net/blob/master/examples/ju/benchmark/accuracy-test.ipynb This example uses the methods described in this file: https://github.com/ria-com/nomeroff-net/blob/master/nomeroff_net/pipelines/base.py https://github.com/ria-com/nomeroff-net/blob/master/nomeroff_net/pipelines/base.py The code will be something like this:

                image = image.astype(np.uint8)
                for cntr in image_points:
                    cntr = np.array(cntr, dtype=np.int32)
                    cv2.drawContours(image, [cntr], -1, (0, 0, 255), 2)
                for target_box in image_bboxs:
                    cv2.rectangle(image,
                                  (int(target_box[0]), int(target_box[1])),
                                  (int(target_box[2]), int(target_box[3])),
                                  (0, 255, 0),
                                  1)
                plt.imshow(image)
                plt.show()

— Reply to this email directly, view it on GitHub https://github.com/ria-com/nomeroff-net/issues/274#issuecomment-1578154418, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEFRZH72NCHRRFZ6X43355DXJ3RL5ANCNFSM6AAAAAAY4ADO5U. You are receiving this because you authored the thread.

ApelSYN commented 1 year ago
  1. In our code, a lot of calculations take place not only on the GPU.
  2. To improve performance, it is necessary to organize the code as a service. Here you will find some examples of recognition services: https://github.com/ria-com/nomeroff-net/tree/master/examples/py/rest_examples
  3. If you plan to use jpeg photos only, you can speed up loading them into memory using the "libjpeg-turbo" library.