OlafenwaMoses / ImageAI

A python library built to empower developers to build applications and systems with self-contained Computer Vision capabilities
https://www.genxr.co/#products
MIT License
8.48k stars 2.18k forks source link

Fix slow validation and corrected weight loading method log message. #797

Closed Yodeman closed 1 year ago

Yodeman commented 1 year ago

The log message of the __load_model method was confusing according to #792 . This PR corrects the place where the message for successful weights loading is executed.

Yodeman commented 1 year ago

Hi @OlafenwaMoses,

I was going through the issues page and found #774 , it's probably not related to the recent ImageAI version, but I discovered the validation process of the latest release takes minutes compared to the training process that takes few seconds (on GPU) . I checked the yolo model utilities and found that the current non-maximum suppression (NMS) uses loops (nested), which might be contributing to the slow NMS execution. I have tried to improve this by removing the loops and using vectorized operations and more optimized torch functions. I tested the implementation on hololens datasets and execution time reduced from minutes to few seconds (on GPU).

OlafenwaMoses commented 1 year ago

Great work there @Yodeman . This looks good.