kristinbranson / APT

Animal Part Tracker
GNU General Public License v3.0
71 stars 16 forks source link

video cropping issue #363

Open gainbrew opened 2 years ago

gainbrew commented 2 years ago

Hey guys,

I recently encountered an issue when working on training landmarks. The video suddenly appears cropped so that I cannot view the entire frame, I can only see a small portion that I zoomed in on at some point. When zooming out the screen is blank where there should be the rest of the frame. I have attached screenshots for clarity. One is a new project using the same video- where we can see the entire frame. The other one shows what happens when I open the video in the project I have been working in. So it must be linked to this project somehow, since starting a new project with the same video doesn't lead to the same issue. Hoping to resolve this within the project so I don't need to start training over.

Thanks, Ben

normal view corrupted

allenleetc commented 2 years ago

Hey Ben,

Whoa that's interesting. Did the problem first manifest when you tried to zoom out in the 'bad'/original project? It sounds like you are both i) unable to reproduce this behavior in any new project/movie and ii) unable to make the 'bad zoom' go away in the original project.

I've seen graphics artifacts from time to time when playing movies, but usually they are transient and go away fairly quickly. Can you try the following if you haven't already?

The issue sounds like some kind of low-level graphics issue. APT projects do store some movie-related metadata, but it's hard to see how the problem could be tied to a project that is eg loaded from a fresh MATLAB. (A brand new VideoReader object should be created when the movie is first shown, etc.)

It's possible that some of the notes in this doc page could relate or interact with the bug: https://www.mathworks.com/help/matlab/creating_plots/resolving-low-level-graphics-issues.html Ideally the problem resolves another way, but including this just to brainstorm.

gainbrew commented 2 years ago

Hey Allen,

Thanks for your help with this. That's correct, the problem showed up at some point after having zoomed in and out a bunch of times. It did not occur the first time zooming out after zooming in, this was several hours into training. Also true that I am unable to make a bad zoom go away in this project.

I had tried all of those suggestions to no avail, and just gave it another shot but still have the same problem. I'll read over the doc page you included, hopefully there is something in there!

-Ben

gainbrew commented 2 years ago

I should note that when adding a video using manage movies, the videos that I add to the project end up with this same cropping issue. This is unique to this project as they look fine if I start a new project or add them to a different project.

arobie commented 2 years ago

Not sure it's helpful, but just to make sure you know that you can export the labels from this project and import them into a new project. I wasn't sure if your concern about restarting training was doing the labeling or the training of the tracker, if it's the second then please ignore me. Cheers Alice

On Wed, Jul 28, 2021 at 10:26 AM gainbrew @.***> wrote:

I should note that when adding a video using manage movies, the videos that I add to the project end up with this same cropping issue. This is unique to this project as they look fine if I start a new project or add them to a different project.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kristinbranson/APT/issues/363#issuecomment-888354212, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAISKEFYPG5FZFKC5GJOA43T2AHSNANCNFSM5BCYHG2Q .

gainbrew commented 2 years ago

Ah! That's a good workaround. Mostly was concerned about having to do all the labelling again since I can just run the training and walk away. Thanks!

-Ben

allenleetc commented 2 years ago

I should note that when adding a video using manage movies, the videos that I add to the project end up with this same cropping issue. This is unique to this project as they look fine if I start a new project or add them to a different project.

Huh, this is suggestive of a bug rather than a lower-level graphics issue. Are you using cropping in your project? (This is under File>Edit Cropping.) Is it possible to share the project and one of the problem movies (maybe the 'original' problem movie)? Can't see a smoking gun yet but APT does have various cropping and view functionality and maybe something got triggered.

gainbrew commented 2 years ago

I wasn't using any cropping in the project to my knowledge. I did use the targets pane a lot to zoom in and out on different regions while labeling and training. Below is a link to a drive folder with the relevant project and movie. Thanks for your help!

The workaround that Alice provide is very helpful so I will just import all the labels to a new project, but I really appreciate your help narrowing this down.

https://drive.google.com/file/d/1GJj-qAtQ9vXtNqLko2cZDqOqby1tUrdu/view?usp=sharing

-Ben

allenleetc commented 2 years ago

Hey Ben, I checked out your project and it seems to have Crops defined (!). You can see this by selecting File>Edit Cropping. (When selecting this option, APT currently warns you that any changes/edits to your crop definitions will clear your existing tracker, as this changes your training data. So please back up or copy your project to be safe if this tracker is important.)

This would explain what you encountered, as when a movie has crops defined, it is basically as if the movie was loaded into APT with that restricted field of view.

I think it wouldn't be difficult to define Crops unintentionally. For instance a misclick could enter Crop Mode, and it then it might be natural to hit 'Finish', which would actually set up Crops.

I'm going to leave this open as there may be some usability improvements here. There's also a couple of oddities where I can't seem to properly clear the crops from the project (leaving the views permanently zoomed-in). But with your new project hopefully you should be good to go and this won't be a recurring bug.

gainbrew commented 2 years ago

Oh wow! Glad you were able to figure that out, not sure how that happened but I'll be sure to be more cognizant of that possibility going forward. I did look at File>Edit Cropping last week but I must have failed to see that a crop was defined. It looks like on my end I was able to clear the crop from the project and re-train the tracker on all of the labels I had defined, so that's saves me work. I appreciate your help Allen!

allenleetc commented 2 years ago

You're welcome glad you are running!