@@ -381,7 +381,7 @@ def handle_missing_bp(animal_skeletons: list):
381381 if HANDLE_MISSING == 'pass' :
382382 #do nothing
383383 pass
384- if HANDLE_MISSING == 'skip' :
384+ elif HANDLE_MISSING == 'skip' :
385385 #remove the whole skeleton
386386 animal_skeletons .remove (skeleton )
387387 break
@@ -409,7 +409,7 @@ def calculate_skeletons_dlc_live(pose) -> list:
409409 skeletons = [transform_2skeleton (pose )]
410410 return skeletons
411411
412- def calculate_sleap_skeletons (pose , animals_number )-> list :
412+ def calculate_sleap_skeletons (pose )-> list :
413413 """
414414 Creating skeleton from sleap output
415415 """
@@ -429,28 +429,36 @@ def calculate_skeletons(peaks: dict, animals_number: int) -> list:
429429 """
430430 if MODEL_ORIGIN == 'DLC' :
431431 animal_skeletons = calculate_dlstream_skeletons (peaks , animals_number )
432- if SPLIT_MA :
432+ if animals_number != 1 and SPLIT_MA :
433433 animal_skeletons = split_flat_skeleton (animal_skeletons )
434+ else :
435+ pass
434436
435437 elif MODEL_ORIGIN == 'MADLC' :
436438 animal_skeletons = calculate_ma_skeletons (peaks , animals_number )
437439 if FLATTEN_MA :
438440 animal_skeletons = flatten_maDLC_skeletons (animal_skeletons )
441+ else :
442+ pass
439443
440444 elif MODEL_ORIGIN == 'DLC-LIVE' or MODEL_ORIGIN == 'DEEPPOSEKIT' :
441445 animal_skeletons = calculate_skeletons_dlc_live (peaks )
442446 if animals_number != 1 and not SPLIT_MA :
443447 raise SkeletonError ('Multiple animals are currently not supported by DLC-LIVE.'
444448 ' If you are using differently colored animals, please refer to the bodyparts directly (as a flattened skeleton) or use SPLIT_MA in the advanced settings.' )
445- if SPLIT_MA :
449+ elif SPLIT_MA :
446450 animal_skeletons = split_flat_skeleton (animal_skeletons )
451+ else :
452+ pass
447453
448454 elif MODEL_ORIGIN == 'SLEAP' :
449- animal_skeletons = calculate_sleap_skeletons (peaks , animals_number )
455+ animal_skeletons = calculate_sleap_skeletons (peaks )
450456 if FLATTEN_MA :
451457 animal_skeletons = flatten_maDLC_skeletons (animal_skeletons )
452- elif SPLIT_MA :
458+ elif animals_number != 1 and SPLIT_MA :
453459 animal_skeletons = split_flat_skeleton (animal_skeletons )
460+ else :
461+ pass
454462
455463 animal_skeletons = handle_missing_bp (animal_skeletons )
456464
0 commit comments