File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -323,11 +323,16 @@ def get_pose_mp(input_q, output_q):
323323 if input_q .full ():
324324 index , frame = input_q .get ()
325325 start_time = time .time ()
326- frame = frame [:, :, ::- 1 ]
327- #this is weird, but i without it, it does not seem to work...
328- frames = np .array ([frame ])
326+ input_frame = frame [:, :, ::- 1 ]
327+ #this is weird, but without it, it does not seem to work...
328+ frames = np .array ([input_frame ])
329329 prediction = sleap_model .predict (frames [[0 ]], batch_size = 1 )
330- peaks = prediction ['instance_peaks' ][0 , :]
330+ #check if this is multiple animal instances or single animal model
331+ if sleap_model .name == 'single_instance_inference_model' :
332+ #get predictions (wrap it again, so the behavior is the same for both model types)
333+ peaks = np .array ([prediction ['peaks' ][0 , :]])
334+ else :
335+ peaks = prediction ['instance_peaks' ][0 , :]
331336 analysis_time = time .time () - start_time
332337 output_q .put ((index ,peaks ,analysis_time ))
333338 else :
You can’t perform that action at this time.
0 commit comments