Skip to content

Commit d4bdbdc

Browse files
committed
Log number of used frames to INFO
1 parent a644315 commit d4bdbdc

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

vitallens/methods/vitallens.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ def __call__(
122122
start_idxs = [i * (split_len - API_OVERLAP) for i in range(n_splits)]
123123
end_idxs = [min(start + split_len, inputs_n) for start in start_idxs]
124124
start_idxs = [max(0, end - split_len) for end in end_idxs]
125-
logging.info("Running inference for {} frames using {} request(s)...".format(expected_ds_n, n_splits))
125+
logging.info(
126+
f"Analyzing video of {expected_ds_n} frames using {n_splits} request{'s' if n_splits > 1 else ''}. "
127+
f"Using {n_splits * split_len} frames in total{' including overlaps' if n_splits > 1 else ''}...")
126128
# Process the splits in parallel
127129
with concurrent.futures.ThreadPoolExecutor() as executor:
128130
results = list(executor.map(lambda i: self.process_api_batch(
@@ -244,6 +246,7 @@ def process_api_batch(
244246
payload["state"] = base64.b64encode(self.state.astype(np.float32).tobytes()).decode('utf-8')
245247
# Adjust idxs
246248
idxs = idxs[(self.n_inputs-1):] - (self.n_inputs-1)
249+
logging.debug(f"Providing state, which means that {self.n_inputs-1} less frames will be used and results for {self.n_inputs-1} less frames will be returned.")
247250
# Ask API to process video
248251
response = requests.post(API_URL, headers=headers, json=payload)
249252
response_body = json.loads(response.text)

0 commit comments

Comments
 (0)