Closed qqaazz0222 closed 3 months ago
def check_falldown(action_name='Normal', confidence=0, threshold=0.6):
if action_name == 'Fall Down' and threshold < confidence:
return True
return False
max값을 받아오도록 되어있었는데, max값 수치가 평균 0.9 이상으로 관측됨
def Falldown(data_pipe, event_pipe):
args = parse_args()
action_model = TSSTG()
data_pipe.send(True)
while True:
action_name = 'None'
confidence = 0
data = data_pipe.recv()
if data:
tracks, meta_data = data
for i, track in enumerate(tracks):
skeletons = track.skeletons
if len(skeletons) < args.frame_step:
continue
tid = track.track_id
skeletons = preprocess(skeletons=skeletons, frame_step=args.frame_step)
out = action_model.predict(skeletons, meta_data['frame_size'])
action_name = action_model.class_names[out[0].argmax()]
confidence = out[0][1]
if check_falldown(action_name=action_name, confidence=confidence, threshold=args.threshhold):
tid = 1
LOGGER.info("action: falldown")
event_pipe.send({'action': "falldown", 'id':tid, 'cctv_id':meta_data['cctv_id'], 'current_datetime':meta_data['current_datetime']})
else:
time.sleep(0.0001)
현상
모든 프레임에 대해 이벤트 발생