-
Notifications
You must be signed in to change notification settings - Fork 673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Pupil Mobile recordings without world video #1071
Conversation
@@ -57,6 +57,9 @@ def _wrapper(self, pipe, _should_terminate_flag, generator, *args, **kwargs): | |||
|
|||
def fetch(self): | |||
'''Fetches progress and available results from background''' | |||
if self.completed or self.canceled: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we add this here we can remove the test in line 80 (83 in this commit.)
pupil_src/launchables/player.py
Outdated
@@ -424,10 +427,10 @@ def handle_notifications(n): | |||
g_pool.new_seek = False | |||
try: | |||
new_frame = g_pool.capture.get_frame() | |||
except EndofVideoFileError: | |||
except (EndofVideoFileError, IndexError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why are we hitting index error? Can we not catch this in Video and fake capture and re-raise as EndofVideoFileError maybe rename to EndofVideoError while we are at it?
glfw.glfwSetWindowShouldClose(window, True) | ||
try: | ||
update_recording_to_recent(rec_dir) | ||
except AssertionError as err: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raising the error to log is good. Also keeping the window open and displaying the error in the text field could be better no?
pupil_src/shared_modules/exporter.py
Outdated
@@ -155,7 +160,7 @@ def export(rec_dir, user_dir, min_data_confidence, start_frame=None, end_frame=N | |||
while frames_to_export > current_frame: | |||
try: | |||
frame = cap.get_frame() | |||
except EndofVideoFileError: | |||
except (EndofVideoFileError, IndexError): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as in player
source_path = self.g_pool.capture.source_path | ||
|
||
try: | ||
source_path = self.g_pool.capture.source_path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why? Fake capture should be api conform. self.g_pool.capture.source_path should point to dfn/dfdfgs/world.fake
. We should still be able to run detection on it.
@@ -283,9 +283,14 @@ def invalidate_marker_cache(self): | |||
self.init_marker_cacher() | |||
|
|||
def init_marker_cacher(self): | |||
try: | |||
video_file_path = self.g_pool.capture.source_path | |||
except AttributeError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as in gaze producers.
frame_rate = 30 | ||
timestamps = np.arange(min_ts, max_ts, 1/frame_rate) | ||
np.save(os.path.join(rec_dir, 'world_timestamps'), timestamps) | ||
save_object({'frame_rate': frame_rate, 'frame_size': (1280, 720)}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a version field. We might add more stuff later...
|
||
|
||
class Playback_Source(Base_Source): | ||
allowed_speeds = [.25, .5, 1., 1.5, 2., 4.] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
strange variable name. Better: availalbe_speeds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but its fine for now. We be gone we refactor anyways.
Creates an artificial video source in case that no world video was encountered. Timestamps will be generated based on encountered eye video timestamps.