Fix typo in box merge#4
Conversation
Fixed box merge logic to correctly merge the boxes into a larger box. Looks like a typo. Was causing mosaics to flash for a frame or causing some mosaics to not be cleaned when boxes were nearby one another.
|
There is still another issue I'm seeing sometimes when the merged boxes/masks go from being combined to being split. One of them doesn't get cleaned for a single frame sometimes. Still trying to find the source of that though. Edit: This turned out to just be the model not detecting a mosaic in that frame. Just happened to be at a frame where a merge was happening previously. |
… certain videos framerate being off and exceptions being thrown. Should attempt to process the video if this occurs. Seems to be happening because of a 'off by one' frame number on some videos. Harmless to catch exception and continue
|
Added a try/except to the main cli portion. There seems to be an 'off by 1' issue with frame numbers in the code that is completely killing the progress at the end of a video. Maybe we should catch everything here. No reason to lose the progress of an entire run because of something. Should always attempt to produce a result. It's likely happening with variable framerate videos and the next() calls throwing exceptions when the frame count is off. |
|
Regarding the frame count issue: We get the frame count in I see two options, either we 1) count the frames (in ffprobe this could be done with the
Let's go with 2) as 1) would just be too slow for files longer than a few minutes. |
Agreed. It's easier to just catch the case when we are off by one. Where I added is probably not the place you want to do it though. Feel free to fix that outside this PR because I'm still getting familiar with the code. Biggest issue is the min/max typo though. If you want to cherry-pick that from here or add it yourself. Fix greatly reduces "flashing" when boxes are merging/splitting. Though, like I said, there is still "flashing" mosaics showing sometimes for another reason I'm trying to pinpoint. It's happening on box merge frame still but I don't know why. |
|
@wheezy1749 There is a non-zero chance I fixed it in 76a8fe5 If can revert your changes in this PR except the fix for the min/box box thingy I'd be happy to merge it. |
…ues with certain videos framerate being off and exceptions being thrown. Should attempt to process the video if this occurs. Seems to be happening because of a 'off by one' frame number on some videos. Harmless to catch exception and continue" This reverts commit b682d88.
Sure. I'll test it soon.
Reverted to just the min/max fix. |
|
Done, thanks for the fix! |
Fixed box merge logic to correctly merge the boxes into a larger box. Looks like a typo. Was causing mosaics to flash for a frame or causing some mosaics to not be cleaned when boxes were nearby one another.