Skip to content
Snippets Groups Projects
Commit e232d427 authored by Alán Muñoz's avatar Alán Muñoz
Browse files

add logging img fetch time

parent 877b633a
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ import json
import time
from pathlib import Path
from typing import Iterable
from time import perf_counter
import h5py
import numpy as np
......@@ -24,6 +25,8 @@ from requests_toolbelt.multipart.encoder import MultipartEncoder
from agora.io.utils import Cache, accumulate, get_store_path
import logging
################### Dask Methods ################################
def format_segmentation(segmentation, tp):
"""Format a single timepoint into a dictionary.
......@@ -141,10 +144,14 @@ class BabyRunner:
def run_tp(self, tp, with_edgemasks=True, assign_mothers=True, **kwargs):
"""Simulating processing time with sleep"""
# Access the image
t = perf_counter()
img = self.get_data(tp)
logging.debug(f"Timing:BF_fetch:{perf_counter()-t}s")
t = perf_counter()
segmentation = self.crawler.step(
img, with_edgemasks=with_edgemasks, assign_mothers=assign_mothers, **kwargs
)
logging.debug(f"Timing:crawler_step:{perf_counter()-t}s")
return format_segmentation(segmentation, tp)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment