def get_version(): modules_path = os.path.join( os.path.abspath(__file__).rsplit(os.path.sep, 2)[0], 'pupil_src', 'shared_modules') sys.path.append(modules_path) from git_version import get_tag_commit return get_tag_commit()
def main(target_dir): modules_path = os.path.join(os.path.abspath(__file__).rsplit(os.path.sep,2)[0],'pupil_src','shared_modules') sys.path.append(modules_path) from git_version import get_tag_commit version = get_tag_commit() print "Current version of Pupil: ",version with open(os.path.join(target_dir,'_version_string_'),'w') as f: f.write(version) print 'Wrote version into: %s' %os.path.join(target_dir,'_version_string_')
def main(target_dir): modules_path = os.path.join( os.path.abspath(__file__).rsplit(os.path.sep, 2)[0], 'pupil_src', 'shared_modules') sys.path.append(modules_path) from git_version import get_tag_commit version = get_tag_commit() print "Current version of Pupil: ", version with open(os.path.join(target_dir, '_version_string_'), 'w') as f: f.write(version) print 'Wrote version into: %s' % os.path.join(target_dir, '_version_string_')
def stop_and_destruct(self): try: camera_matrix = np.load("camera_matrix.npy") dist_coefs = np.load("dist_coefs.npy") cam_path = os.path.join(self.path, "camera_matrix.npy") dist_path = os.path.join(self.path, "dist_coefs.npy") np.save(cam_path, camera_matrix) np.save(dist_path, dist_coefs) except: print "no camera intrinsics found, will not copy them into recordings folder" timestamps_path = os.path.join(self.path, "timestamps.npy") np.save(timestamps_path,np.array(self.timestamps)) try: with open(self.meta_info_path, 'a') as f: f.write("Duration Time: \t"+ self.get_rec_time_str()+ "\n") f.write("World Camera Frames: \t"+ str(self.frame_count)+ "\n") f.write("World Camera Resolution: \t"+ str(self.width)+"x"+str(self.height)+"\n") f.write("Capture Software Version: \t"+ get_tag_commit()+ "\n") f.write("user:\t"+os.getlogin()+"\n") try: sysname, nodename, release, version, machine = os.uname() except: sysname, nodename, release, version, machine = sys.platform,None,None,None,None f.write("Platform:\t"+sysname+"\n") f.write("Machine:\t"+nodename+"\n") f.write("Release:\t"+release+"\n") f.write("Version:\t"+version+"\n") except: print "Could not save metadata. Please report this bug!" print "Stopping recording" self.shared_record.value = False self.alive = False
import atb from uvc_capture import autoCreateCapture, EndofVideoFileError, FileSeekError, FakeCapture # helpers/utils from methods import normalize, denormalize, Temp from player_methods import correlate_gaze, patch_meta_info, is_pupil_rec_dir from gl_utils import basic_gl_setup, adjust_gl_view, clear_gl_screen, draw_gl_point_norm, make_coord_system_pixel_based, make_coord_system_norm_based, create_named_texture, draw_named_texture #get the current software version if getattr(sys, 'frozen', False): with open(version_file) as f: version = f.read() else: from git_version import get_tag_commit version = get_tag_commit() # Plug-ins from vis_circle import Vis_Circle from vis_cross import Vis_Cross from vis_polyline import Vis_Polyline from display_gaze import Display_Gaze from vis_light_points import Vis_Light_Points from seek_bar import Seek_Bar from trim_marks import Trim_Marks from export_launcher import Export_Launcher from scan_path import Scan_Path from offline_marker_detector import Offline_Marker_Detector from marker_auto_trim_marks import Marker_Auto_Trim_Marks from pupil_server import Pupil_Server from filter_fixations import Filter_Fixations
if len(sys.argv) >=2: from eye import eye_profiled as eye from world import world_profiled as world else: from eye import eye from world import world from methods import Temp #get the current software version if getattr(sys, 'frozen', False): with open(version_file) as f: version = f.read() else: from git_version import get_tag_commit version = get_tag_commit() def main(): # To assign camera by name: put string(s) in list eye_src = ["Microsoft", "6000","Integrated Camera"] world_src = ["Logitech Camera","(046d:081d)","C510","B525", "C525","C615","C920","C930e"] # to assign cameras directly, using integers as demonstrated below # eye_src = 1 # world_src = 0 # to use a pre-recorded video. # Use a string to specify the path to your video file as demonstrated below # eye_src = "/Users/mkassner/Downloads/1-4/000/eye.avi" # world_src = "/Users/mkassner/Desktop/2014_01_21/000/world.avi"
def get_version(): modules_path = os.path.join(os.path.abspath(__file__).rsplit(os.path.sep,2)[0],'pupil_src','shared_modules') sys.path.append(modules_path) from git_version import get_tag_commit return get_tag_commit()