From e018b50b86e83268da0d31abaa3d001104b8b043 Mon Sep 17 00:00:00 2001 From: Antoine Falisse Date: Tue, 11 Jun 2024 16:09:19 -0700 Subject: [PATCH] adding logs --- utils.py | 5 ----- utilsDetector.py | 9 ++++++++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/utils.py b/utils.py index 20855d13..b9e36171 100644 --- a/utils.py +++ b/utils.py @@ -13,9 +13,6 @@ import zipfile import time -import logging -logging.basicConfig(level=logging.INFO) - import numpy as np import pandas as pd from scipy import signal @@ -121,8 +118,6 @@ def getCreatedAt(trial): return sessionJson def getSubjectJson(subject_id): - logging.info('Getting subject json {}subjects/{}/'.format(API_URL, subject_id)) - logging.info('API_TOKEN: {}'.format(API_TOKEN)) subjectJson = requests.get(API_URL + "subjects/{}/".format(subject_id), headers = {"Authorization": "Token {}".format(API_TOKEN)}).json() return subjectJson diff --git a/utilsDetector.py b/utilsDetector.py index 30386542..1c97be64 100644 --- a/utilsDetector.py +++ b/utilsDetector.py @@ -7,6 +7,9 @@ import sys import time +import logging +logging.basicConfig(level=logging.INFO) + from decouple import config from utils import getOpenPoseMarkerNames, getMMposeMarkerNames, getVideoExtension @@ -308,8 +311,10 @@ def runMMposeVideo( try: # wait until the video is processed (i.e. until the video is removed -- then json should be ready) start = time.time() + logging.info("Processing mmpose. Before waiting for video to be processed.") while True: if not os.path.isfile(vid_path): + logging.info("Processing mmpose. Video not available. Break.") break if start + 60*60 < time.time(): @@ -317,8 +322,10 @@ def runMMposeVideo( time.sleep(0.1) + logging.info("Processing mmpose. Before copying.") # copy /data/output to pathOutputPkl - os.system("cp /data/output_mmpose/* {pathOutputPkl}/".format(pathOutputPkl=pathOutputPkl)) + os.system("cp /data/output_mmpose/* {pathOutputPkl}/".format(pathOutputPkl=pathOutputPkl)) + logging.info("Processing mmpose. After copying.") pkl_path_tmp = os.path.join(pathOutputPkl, 'human.pkl') os.rename(pkl_path_tmp, pklPath)