mbari-org / cthulhu

Cross-platform video player that supports annotation localizations (i.e. bounding boxes)
https://mbari-media-management.github.io/cthulhu/
Other
4 stars 2 forks source link

Fixing #4 #6

Closed carueda closed 3 years ago

carueda commented 3 years ago

Hi @hohonuuli ... for now, just a draft PR to facilitate discussion.

carueda commented 3 years ago

Brian, I think the change has been completed AFAICT now. I've done basic testing running the GUI, pausing, drawing a rectangle, replaying and checking (visually) that the duration (now indicated in millis) of the drawn rectangle is as expected (that is, about twice as long per the value in the Settings dialog:

image

(5000 millis in this test just to facilitate the "visual" verification).

Of course, please take a look and let me know what you think.

hohonuuli commented 3 years ago

@carueda Thanks for the PR. I ran a sanity check with the window set to 100ms. With this setting, Cthulhu is skipping over and not drawing bounding boxes during playback. I'm thinking that that the the way localizations are selected to be drawn inside cthulhu is not fast enough to keep up with the playback. I've posted a video of this issue at https://youtu.be/wrB0GMTFmN0

carueda commented 3 years ago

OK, I'll continue reviewing the code to see where relevant adjustments are needed. BTW, I would appreciate a live session as I'm not sure how to "integrate" that other GUI shown in your video.

hohonuuli commented 3 years ago

There's a few pieces to running a live session. Here's the steps.

Spin up M3 microservices pointing at MBARI's development databases

  1. git clone git@bitbucket.org:mbari/m3-microservices.git
  2. cd m3-microservices
  3. dev_mbari.sh up

Run VARS Annotation from source code (gives access to debugging)

  1. git clone git@github.com:mbari-media-management/vars-annotation.git
  2. cd vars-annotation
  3. gradlew run --info
hohonuuli commented 3 years ago

dev_mbari.sh up <- this shell script passes commands through to docker compose. So you can use dev_mbari.sh up -d, dev_mbari.sh down, etc.

hohonuuli commented 3 years ago

Also, you should be running Java 11 when running VARS annotation. It uses java modules and changes to modules after Java 11 break things. When Java 17 comes out, I'll update VARS to use that version.

carueda commented 3 years ago

Just some quick misc notes while playing with the annotations:

(no replies requested for now )

carueda commented 3 years ago

Just captured this video with those adjustments f98c5ba: https://youtu.be/Pu2pc6pPbm0

Note, I'm still just running cathulhu alone (./gradlew -t run), not with any other "integration" yet.

This change does seem to have improved the handling a bit, although, occasionally there are still some missing rectangles when replaying..

As indicated in the comments, seems like libvlc_media_player_get_time does not report with enough time resolution. I changed the timer period to 100ms (previously 500ms), but still the delta of the status time is always > ~250ms, more often ~ 400-500ms.

Is there a way to instruct libvlc to use a finer resolution?

hohonuuli commented 3 years ago

re: duration: In VARS, a user may set a duration or, when annotations are imported from ML. they may be a duration set. Basically it says, we saw "this thing" for "this long'. The Cthulhu player never sets the duration value though; the duration is always set by another application.

I think Cthulhu has some handling for duration internally, so how long a bounding box is drawn includes the duration. I think Cthulhu should ignore the duration or maybe we can toggle it on/off. I can discuss the details of why we might ignore duration in our next VAA meeting.

carueda commented 3 years ago

@hohonuuli

Since mediaPlayer.status().time() does not report with the desired time precision, I did the following:

This strategy seems to have improved this overall handling, short demo here: https://youtu.be/V3Ym595yuHI . Please have a look at these changes.

Next, I'll try to "integrate" the VARS Annotation build and see how this all behaves.


EDIT: btw, i tried the MediaPlayerEventListener approach, but the listener is also called not more frequently than every 250ms. (no surprise here, as the same basic mechanism is used elsewhere in the code.)

hohonuuli commented 3 years ago

Wow! Your video shows a HUGE improvement. Would mind posting that into the vars-annotation-assistance slack channel to share with the team? That looks great.