3737)
3838
3939
40- from utils .configloader import THRESHOLD , POOL_SIZE
40+ from utils .configloader import THRESHOLD , POOL_SIZE , TRIGGER
4141
4242
4343""" experimental classification experiment using Simba trained classifiers in a pool which are converted using the pure-predict package"""
@@ -62,7 +62,7 @@ def __init__(self):
6262 prob_threshold = THRESHOLD , class_process_pool = self ._process_pool , debug = False
6363 )
6464 self ._event = None
65- # is not fully utilized in this experiment but is usefull to keep for further adaptation
65+ # is not fully utilized in this experiment but is useful to keep for further adaptation
6666 self ._current_trial = None
6767 self ._max_reps = 999
6868 self ._trial_count = {trial : 0 for trial in self ._trials }
@@ -173,7 +173,7 @@ class SimbaBehaviorPoolExperiment:
173173
174174 def __init__ (self ):
175175 """Classifier process and initiation of behavior trigger"""
176- self .experiment_finished = False
176+ self ._process_experiment = ExampleProtocolProcess ()
177177 self ._process_pool = SimbaProcessPool (POOL_SIZE )
178178 # pass classifier to trigger, so that check_skeleton is the only function that passes skeleton
179179 # initiate in experiment, so that process can be started with start_experiment
@@ -223,14 +223,18 @@ def check_skeleton(self, frame, skeleton):
223223 if self ._current_trial == trial :
224224 self ._current_trial = None
225225 self ._trial_timers [trial ].start ()
226+ self ._process_experiment .set_trial (self ._current_trial )
227+ else :
228+ pass
229+ return result ,response
226230
227231 @property
228232 def _trials (self ):
229233 """
230234 Defining the trials
231235 """
232236 trials = {
233- "SimBA1 " : dict (
237+ "DLStream_test " : dict (
234238 trigger = self ._behaviortrigger .check_skeleton , target_prob = None , count = 0
235239 )
236240 }
@@ -249,6 +253,7 @@ def start_experiment(self):
249253 """
250254 Start the experiment
251255 """
256+ self ._process_experiment .start ()
252257 self ._process_pool .start ()
253258 if not self .experiment_finished :
254259 self ._exp_timer .start ()
@@ -258,6 +263,7 @@ def stop_experiment(self):
258263 Stop the experiment and reset the timer
259264 """
260265 self .experiment_finished = True
266+ self ._process_experiment .end ()
261267 self ._process_pool .end ()
262268 print ("Experiment completed!" )
263269 self ._exp_timer .reset ()
@@ -288,11 +294,12 @@ class BsoidBehaviorPoolExperiment:
288294 def __init__ (self ):
289295 """Classifier process and initiation of behavior trigger"""
290296 self .experiment_finished = False
297+ self ._process_experiment = ExampleProtocolProcess ()
291298 self ._process_pool = BsoidProcessPool (POOL_SIZE )
292299 # pass classifier to trigger, so that check_skeleton is the only function that passes skeleton
293300 # initiate in experiment, so that process can be started with start_experiment
294301 self ._behaviortrigger = BsoidClassBehaviorPoolTrigger (
295- target_class = THRESHOLD , class_process_pool = self ._process_pool
302+ target_class = TRIGGER , class_process_pool = self ._process_pool , debug = False
296303 )
297304 self ._event = None
298305 # is not fully utilized in this experiment but is usefull to keep for further adaptation
@@ -337,14 +344,19 @@ def check_skeleton(self, frame, skeleton):
337344 if self ._current_trial == trial :
338345 self ._current_trial = None
339346 self ._trial_timers [trial ].start ()
347+ self ._process_experiment .set_trial (self ._current_trial )
348+ else :
349+ pass
350+ return result ,response
340351
341352 @property
342353 def _trials (self ):
343354 """
344355 Defining the trials
356+ Target class is the cluster of interest and can be changed with every call of check_skeleton
345357 """
346358 trials = {
347- "BSOID1 " : dict (
359+ "DLStream_test " : dict (
348360 trigger = self ._behaviortrigger .check_skeleton , target_class = None , count = 0
349361 )
350362 }
@@ -364,6 +376,7 @@ def start_experiment(self):
364376 Start the experiment
365377 """
366378 self ._process_pool .start ()
379+ self ._process_experiment .start ()
367380 if not self .experiment_finished :
368381 self ._exp_timer .start ()
369382
@@ -372,6 +385,7 @@ def stop_experiment(self):
372385 Stop the experiment and reset the timer
373386 """
374387 self .experiment_finished = True
388+ self ._process_experiment .end ()
375389 self ._process_pool .end ()
376390 print ("Experiment completed!" )
377391 self ._exp_timer .reset ()
@@ -388,6 +402,7 @@ def get_info(self):
388402 return info
389403
390404
405+
391406"""Social or multiple animal experiments in combination with SLEAP or non-flattened maDLC pose estimation"""
392407
393408
0 commit comments