Skip to content

Commit

Permalink
testing reprocess flag through metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinefalisse committed Jun 28, 2024
1 parent 094dbd1 commit 038b00a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
22 changes: 11 additions & 11 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@
# on processing them. Problem is that these trials then don't have pose pickles, which
# makes is hard for local reprocessing (hrnet still a hassle to install locally on Windows).
# status = trial["status"]
status = 'reprocess'
logging.info(f"Trial status: {status}")
if status == "reprocess":
camerasToUse_c = ['all_available']
else:
camerasToUse_c = ['all']
if any([v["video"] is None for v in trial["videos"]]):
r = requests.patch(trial_url, data={"status": "error"},
headers = {"Authorization": "Token {}".format(API_TOKEN)})
continue
# status = 'reprocess'
# logging.info(f"Trial status: {status}")
# if status == "reprocess":
# camerasToUse_c = ['all_available']
# else:
# camerasToUse_c = ['all']
# if any([v["video"] is None for v in trial["videos"]]):
# r = requests.patch(trial_url, data={"status": "error"},
# headers = {"Authorization": "Token {}".format(API_TOKEN)})
# continue

trial_type = "dynamic"
if trial["name"] == "calibration":
Expand All @@ -151,7 +151,7 @@

try:
# trigger reset of timer for last processed trial
processTrial(trial["session"], trial["id"], trial_type=trial_type, isDocker=isDocker, camerasToUse=camerasToUse_c)
processTrial(trial["session"], trial["id"], trial_type=trial_type, isDocker=isDocker)
# note a result needs to be posted for the API to know we finished, but we are posting them
# automatically thru procesTrial now
r = requests.patch(trial_url, data={"status": "done"},
Expand Down
6 changes: 6 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ def main(sessionName, trialName, trial_id, camerasToUse=['all'],
else:
scalingSetup = scaling_setup

# If reprocess is in sessionMetadata, reprocess with all cameras available
# instead of all cameras. This allows reprocessing of trials with missing
# videos.
if 'reprocess' in sessionMetadata:
camerasToUse = ['all_available']

# %% Paths to pose detector folder for local testing.
if poseDetector == 'OpenPose':
poseDetectorDirectory = getOpenPoseDirectory(isDocker)
Expand Down

0 comments on commit 038b00a

Please sign in to comment.