Skip to content

Commit

Permalink
Merge pull request #219 from stanfordnmbl/error-2-hrnet-detection-pose
Browse files Browse the repository at this point in the history
Intercepting error of human detection pose not detected in hrnet.
  • Loading branch information
AlbertoCasasOrtiz authored Dec 12, 2024
2 parents 43cd355 + 4bfcf1c commit cfe2c9e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions utilsDetector.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,13 @@ def runMMposeVideo(

# copy /data/output to pathOutputPkl
os.system("cp /data/output_mmpose/* {pathOutputPkl}/".format(pathOutputPkl=pathOutputPkl))
pkl_path_tmp = os.path.join(pathOutputPkl, 'human.pkl')
os.rename(pkl_path_tmp, pklPath)

pkl_path_tmp = os.path.join(pathOutputPkl, 'human.pkl')
if os.path.exists(pkl_path_tmp):
os.rename(pkl_path_tmp, pklPath)
else:
raise FileNotFoundError(
"We could not detect any pose in your video. Please verify that the subject is correctly in front of the camera."
)
except Exception as e:
if len(e.args) == 2: # specific exception
raise Exception(e.args[0], e.args[1])
Expand Down

0 comments on commit cfe2c9e

Please sign in to comment.