laurenok24's picture
Upload 10 files
97a245c verified
raw
history blame contribute delete
886 Bytes
from microprograms.errors.angles_micro_programs import applyPositionTightnessError
# from models.pose_estimator.pose_estimator_model_setup import get_pose_estimation
def somersault_microprogram_one_frame(filepath, on_board, expected_som, half_som_count, expected_twists, petal_count, pose_pred=None, diver_detector=None, pose_model=None):
if on_board:
return 0
if expected_som <= half_som_count:
return 0
# if not done with som or twists, need to determine if som or twist
angle = applyPositionTightnessError(filepath, pose_pred, diver_detector=diver_detector, pose_model=pose_model)
if angle is None:
return 0
# if not done with som but done with twists
if expected_som > half_som_count and expected_twists <= petal_count:
return 1
# print("angle:", angle)
if angle <= 80:
return 1
else:
return 0