[Python] YOLO Model only working on imported RoboFlow images

Discussão em 'Python' iniciado por Stack, Junho 18, 2025.

  1. Stack

    Stack Membro Participativo

    So I trained a YOLO model on various datasets for bounding box detection. I used one already annotated dataset from the net, and some of my own pictures I annotated from RoboFlow. I then downloaded the annotated dataset, added it to the previous dataset and then trained the model. While testing it at first I was importing the RoboFlow project and running the model on its images to see how it works. Later I tried the model on an image I uploaded to the environment directly and it was showing no detections. The exact same image from the RoboFlow directory was showing normal detections but isnt working for outside images. What could be the problem here?

    My code:

    def extract_numberplate_text_centroid_line(image_path):
    result = numberplate([image_path], verbose=False)
    pred = result[0].boxes.data.tolist()
    if(len(pred)==0):
    return('No nameplates detected :(')


    Note that there is more code after this which further processes the prediction from the model, and with the RoboFlow directory picture(which looks the exact same as the other picture) it worked perfectly, and the other picture gets stuck at this point saying 'No nameplates detected :('. Also note that I am executing this on Google Colab, and that the annotated YOLO dataset was directly added to the previous dataset on Google Drive on which the YOLO v11 model was consequently trained.

    Edit: I tried a completely different image from outside of that RoboFlow directory, and it worked perfectly. So to surmise, RoboFlow images directly imported work, those EXACT SAME IMAGES from outside imported dont work, and totally separate images work. Why could this be happening. Could this be happening because Google Colab crashed a few times earlier? But ever sine that I have opened an entirely new Colab Notebook on an entirely different google account and am facing the same issues.

    Continue reading...

Compartilhe esta Página