双杠上杠标准

This commit is contained in:
渣渣和 2024-10-11 07:44:34 +08:00
parent e8f80b9fb4
commit 31785cf261
3 changed files with 6 additions and 11 deletions

View File

@ -172,7 +172,6 @@ class BaseExercise(threading.Thread):
) )
return self.img return self.img
def streaming_gen(self): def streaming_gen(self):
while not self.kill_sign: while not self.kill_sign:
if self.is_start and self.img is not None: if self.is_start and self.img is not None:

View File

@ -40,13 +40,10 @@ class Tricep_dip_1(BaseExercise):
self.initial_wrist_2_y = 0 self.initial_wrist_2_y = 0
# 双杠臂屈伸参数 # 双杠臂屈伸参数
self.corner = (0, 480, 230, 410) self.corner = (0, 480, 200, 440)
MediapipeAlgorithmPlugin.set_corner(corner=self.corner) MediapipeAlgorithmPlugin.set_corner(corner=self.corner)
MediapipeAlgorithmPlugin.set_config(config=self.config) MediapipeAlgorithmPlugin.set_config(config=self.config)
self.a = time.time()
self.b = 0
def get_result(self): def get_result(self):
# 人员年龄 # 人员年龄
age = self.info.get(AGE) age = self.info.get(AGE)
@ -142,14 +139,14 @@ class Tricep_dip_1(BaseExercise):
if self.form == 0 and self.pre_pos == 1: if self.form == 0 and self.pre_pos == 1:
if self.readiness_state == 0: if self.readiness_state == 0:
if shoulder_1 > 70 and shoulder_2 > 70: if shoulder_1 > 70 or shoulder_2 > 70:
self.readiness_state = 1 self.readiness_state = 1
self.heel = heel_y self.heel = heel_y
self.speak_driver.add_speak("上杠,听到提示声后开始考试") self.speak_driver.add_speak("上杠,听到提示声后开始考试")
if self.readiness_state == 1: if self.readiness_state == 1:
if (elbow_1 > 157 or elbow_2 > 157) and eye_1_y < wrist_1_y and eye_2_y < wrist_2_y and (shoulder_1 < 30 or shoulder_2 < 30) and heel_y < self.heel - 30: if (elbow_1 > 150 or elbow_2 > 150) and eye_1_y < wrist_1_y and eye_2_y < wrist_2_y and (shoulder_1 < 45 or shoulder_2 < 45) and heel_y < self.heel - 30:
self.time_0 += 1 self.time_0 += 1
if self.time_0 > 15: if self.time_0 > 20:
if vis_shoulder_1 > 0.8 and vis_shoulder_1 > vis_shoulder_2: if vis_shoulder_1 > 0.8 and vis_shoulder_1 > vis_shoulder_2:
self.time_1 += 1 self.time_1 += 1
if self.time_1 > 3: if self.time_1 > 3:
@ -189,7 +186,7 @@ class Tricep_dip_1(BaseExercise):
self.state = 0 self.state = 0
self.time = 0 self.time = 0
if elbow_1 >= 146 and shoulder_1_y < elbow_1_y and shoulder_1_y < self.initial_wrist_1_y - 30 and shoulder_angle > 45 and self.count > 0 and wrist_1_y - self.initial_wrist_1_y < 50: if elbow_1 >= 146 and shoulder_1_y < elbow_1_y and shoulder_1_y < self.initial_wrist_1_y - 30 and shoulder_angle > 30 and self.count > 0 and wrist_1_y - self.initial_wrist_1_y < 50:
self.feedback = "下落" self.feedback = "下落"
if self.state == 0: if self.state == 0:
self.time += 1 self.time += 1
@ -218,7 +215,7 @@ class Tricep_dip_1(BaseExercise):
self.state = 0 self.state = 0
self.time = 0 self.time = 0
if elbow_2 >= 146 and shoulder_2_y < elbow_2_y and shoulder_2_y < self.initial_wrist_2_y - 30 and shoulder_angle > 45 and self.count > 0 and wrist_2_y - self.initial_wrist_2_y < 50: if elbow_2 >= 146 and shoulder_2_y < elbow_2_y and shoulder_2_y < self.initial_wrist_2_y - 30 and shoulder_angle > 30 and self.count > 0 and wrist_2_y - self.initial_wrist_2_y < 50:
self.feedback = "下落" self.feedback = "下落"
if self.state == 0: if self.state == 0:
self.time += 1 self.time += 1

View File

@ -579,7 +579,6 @@ class ExerciseBackend(LSZXBackend.base_driver.BaseDriver):
_count = count _count = count
_score = real_score _score = real_score
elif self.exercise_tag in {PULLUP, TRICEDIP} and had_done == False: elif self.exercise_tag in {PULLUP, TRICEDIP} and had_done == False:
# 主动清空缓存
# 结束屏幕录制 # 结束屏幕录制
video_name = self.project.info[ID] + '_' + self.project.info[ video_name = self.project.info[ID] + '_' + self.project.info[