Search code examples
pythongoogle-colaboratorykaggleconv-neural-networkdarknet

No detection on googlecolab or Kaggle kernel


I am creating an Automatic license plate recognition for Indian plates. I trained separate models for vehicle detection, license plate detection, and character recognition. I am trying to extract frames from video and process one at a time.

I am using the this darknet framework.

my code on github

The problem is whenever I run it on my local machine it works fine and gives the following output: see this image of output

Searching for license plates...
     Processing samples/output/2_1car.png
     Processing samples/output/2_0car.png
Performing Character Recognition...
    Scanning samples/output/2_0car_lp.png
        LP: RJ47CA3205
    Scanning samples/output/2_1car_lp.png
        LP: RJ17CA1931

But when I run my system on googlecolab or Kaggle kernel it detects no objects.

see this image of the output on Kaggle kernel

Loading weights from data/cr/cr.weights...Done!
Searching for vehicles...
    Scanning temp/frames/1.jpg
        0 cars found
Searching for license plates...
Performing Character Recognition...

I have no clue I am doing wrong. And I have been at this for what seems hours. Thanks in advance.


Solution

  • I somehow found the answer by myself. I modified the configuration file for all models.

    # Testing
    batch=1
    subdivisions=1
    # Training
    #batch=256
    #subdivisions=64
    

    For testing change batch and subdivision to 1 and it will work.