1313# loading DeepLabStream configuration
1414# remember when it was called DSC?
1515dsc_config = cfg .ConfigParser ()
16+ adv_dsc_config = cfg .ConfigParser ()
1617
1718
1819def get_script_path ():
@@ -23,6 +24,9 @@ def get_script_path():
2324with open (cfg_path ) as cfg_file :
2425 dsc_config .read_file (cfg_file )
2526
27+ adv_cfg_path = os .path .join (os .path .dirname (__file__ ), 'advanced_settings.ini' )
28+ with open (adv_cfg_path ) as adv_cfg_file :
29+ adv_dsc_config .read_file (adv_cfg_file )
2630# DeepLabCut
2731deeplabcut_config = dict (dsc_config .items ('DeepLabCut' ))
2832
@@ -36,22 +40,13 @@ def get_script_path():
3640MODEL = dsc_config ['Streaming' ].get ('MODEL' )
3741FRAMERATE = dsc_config ['Streaming' ].getint ('FRAMERATE' )
3842OUT_DIR = dsc_config ['Streaming' ].get ('OUTPUT_DIRECTORY' )
39- STREAM = dsc_config ['Streaming' ].getboolean ('STREAM' )
40- MULTI_CAM = dsc_config ['Streaming' ].getboolean ('MULTIPLE_DEVICES' )
41- STACK_FRAMES = dsc_config ['Streaming' ].getboolean ('STACK_FRAMES' ) if dsc_config ['Streaming' ].getboolean (
42- 'STACK_FRAMES' ) is not None else False
43- ANIMALS_NUMBER = dsc_config ['Streaming' ].getint ('ANIMALS_NUMBER' ) if dsc_config ['Streaming' ].getint (
44- 'ANIMALS_NUMBER' ) is not None else 1
45- STREAMS = [str (part ).strip () for part in dsc_config ['Streaming' ].get ('STREAMS' ).split (',' )]
4643CAMERA_SOURCE = dsc_config ['Streaming' ].get ('CAMERA_SOURCE' )
47-
44+ STREAMING_SOURCE = dsc_config [ 'Streaming' ]. get ( 'STREAMING_SOURCE' )
4845# Video
4946VIDEO_SOURCE = dsc_config ['Video' ].get ('VIDEO_SOURCE' )
50- VIDEO = dsc_config ['Video' ].getboolean ('VIDEO' )
5147
5248#IPWEBCAM
5349PORT = dsc_config ['IPWEBCAM' ].get ('PORT' )
54- IPWEBCAM = dsc_config ['IPWEBCAM' ].getboolean ('IPWEBCAM' )
5550
5651
5752# experiment
@@ -60,4 +55,12 @@ def get_script_path():
6055RECORD_EXP = dsc_config ['Experiment' ].getboolean ('RECORD_EXP' )
6156
6257START_TIME = time .time ()
63- EGG = "" .join (format (ord (x ), 'b' ) for x in "Hello there!" )
58+
59+
60+ """advanced settings"""
61+ STREAMS = [str (part ).strip () for part in adv_dsc_config ['Streaming' ].get ('STREAMS' ).split (',' )]
62+ MULTI_CAM = adv_dsc_config ['Streaming' ].getboolean ('MULTIPLE_DEVICES' )
63+ STACK_FRAMES = adv_dsc_config ['Streaming' ].getboolean ('STACK_FRAMES' ) if adv_dsc_config ['Streaming' ].getboolean (
64+ 'STACK_FRAMES' ) is not None else False
65+ ANIMALS_NUMBER = adv_dsc_config ['Streaming' ].getint ('ANIMALS_NUMBER' ) if adv_dsc_config ['Streaming' ].getint (
66+ 'ANIMALS_NUMBER' ) is not None else 1
0 commit comments