[Python] Storage for comparing predicted values with information at specific timing in video

Discussão em 'Python' iniciado por Stack, Agosto 6, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to compare a model that processes video frames and returns a predicted value between 0.0 and 1.0. The prediction attempts to obtain the best estimate between two possible categories. The videos I want to use to test its accuracy are of different lengths, in which there are transitions between situations that have been defined as those two categories. I am interested in developing the code/format on how to compare the prediction with the true value. So I am looking for better proposals for storing the values. I have thought about creating a CSV table where each row is a video and the columns are timestamps for each second. It is feasible to manually write a numerical value of 0 or 1 for each second, as the videos are up to 1.5 minutes long, but I find it somewhat time-consuming to write. I have also thought about doing it with the SRT file format, but perhaps that is too complex. What do you think would be a good methodology for storing, writing, and using this format?

    Example of an SRT file:

    1
    00:00:00,000 –> 00:00:10,000
    0.0

    2
    00:00:31,000 –> 00:00:34,000
    1.0

    3
    00:00:35,000 --> 00:00:37,000
    0.0

    4
    00:00:37,000 --> 00:00:45,000
    1.0


    If there are any questions, I'll be glad to answer. I found interesting sharing this little challenge with the community.

    P.d: In reality, I'm obtaining two values from the prediction [0.0, 0.1] as an example, but I don't see how this changes the problem. I use one float value for the explanation just to simplify.

    Continue reading...

Compartilhe esta Página