Skip to content
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

Merged
merged 12 commits into from
Feb 15, 2018
Merged

Support Pupil Mobile recordings without world video #1071

merged 12 commits into from
Feb 15, 2018

Conversation

papr
Copy link
Contributor

@papr papr commented Feb 12, 2018

Creates an artificial video source in case that no world video was encountered. Timestamps will be generated based on encountered eye video timestamps.

@@ -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:
Copy link
Member

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.)

@@ -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):
Copy link
Member

@mkassner mkassner Feb 14, 2018

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:
Copy link
Member

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?

@@ -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):
Copy link
Member

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
Copy link
Member

@mkassner mkassner Feb 14, 2018

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:
Copy link
Member

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)},
Copy link
Member

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.]
Copy link
Member

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

Copy link
Member

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.

@mkassner mkassner merged commit 42bb922 into pupil-labs:master Feb 15, 2018
@papr papr deleted the world_less branch March 12, 2020 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants