diff --git a/Exercise3/base_exercise.py b/Exercise3/base_exercise.py index b23fb4e..4440875 100644 --- a/Exercise3/base_exercise.py +++ b/Exercise3/base_exercise.py @@ -172,7 +172,6 @@ class BaseExercise(threading.Thread): ) return self.img - def streaming_gen(self): while not self.kill_sign: if self.is_start and self.img is not None: diff --git a/Exercise3/tricep_dip.py b/Exercise3/tricep_dip.py index dc646de..c82a861 100644 --- a/Exercise3/tricep_dip.py +++ b/Exercise3/tricep_dip.py @@ -40,13 +40,10 @@ class Tricep_dip_1(BaseExercise): 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_config(config=self.config) - self.a = time.time() - self.b = 0 - def get_result(self): # 人员年龄 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.readiness_state == 0: - if shoulder_1 > 70 and shoulder_2 > 70: + if shoulder_1 > 70 or shoulder_2 > 70: self.readiness_state = 1 self.heel = heel_y self.speak_driver.add_speak("上杠,听到提示声后开始考试") 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 - if self.time_0 > 15: + if self.time_0 > 20: if vis_shoulder_1 > 0.8 and vis_shoulder_1 > vis_shoulder_2: self.time_1 += 1 if self.time_1 > 3: @@ -189,7 +186,7 @@ class Tricep_dip_1(BaseExercise): self.state = 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 = "下落" if self.state == 0: self.time += 1 @@ -218,7 +215,7 @@ class Tricep_dip_1(BaseExercise): self.state = 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 = "下落" if self.state == 0: self.time += 1 diff --git a/LSZXBackend/exercise_backend.py b/LSZXBackend/exercise_backend.py index 773e00b..15398a9 100644 --- a/LSZXBackend/exercise_backend.py +++ b/LSZXBackend/exercise_backend.py @@ -579,7 +579,6 @@ class ExerciseBackend(LSZXBackend.base_driver.BaseDriver): _count = count _score = real_score elif self.exercise_tag in {PULLUP, TRICEDIP} and had_done == False: - # 主动清空缓存 # 结束屏幕录制 video_name = self.project.info[ID] + '_' + self.project.info[