Skip to content
Snippets Groups Projects

RoiSet facilitates object detection models

Merged Christopher Randolph Rhodes requested to merge dev_obj_det into staging
1 file
+ 8
1
Compare changes
  • Side-by-side
  • Inline
@@ -775,10 +775,17 @@ class RoiSet(object):
@@ -775,10 +775,17 @@ class RoiSet(object):
def acc_obj_ids(self):
def acc_obj_ids(self):
return make_object_ids_from_df(self._df, self.acc_raw.shape_dict)
return make_object_ids_from_df(self._df, self.acc_raw.shape_dict)
# TODO: add docstring
# TODO: make this work with obj det dataset
# TODO: make this work with obj det dataset
@staticmethod
@staticmethod
def deserialize(acc_raw: GenericImageDataAccessor, where: Path, prefix=''):
def deserialize(acc_raw: GenericImageDataAccessor, where: Path, prefix=''):
 
"""
 
Create an RoiSet object from saved files and an image accessor
 
:param acc_raw: accessor to image that contains ROIs
 
:param where: path to directory containing RoiSet serialization files, namely dataframe.csv and a subdirectory
 
named tight_patch_masks
 
:param prefix: starting prefix of patch mask filenames
 
:return:
 
"""
df = pd.read_csv(where / 'dataframe' / (prefix + '.csv'))[['label', 'zi', 'y0', 'y1', 'x0', 'x1']]
df = pd.read_csv(where / 'dataframe' / (prefix + '.csv'))[['label', 'zi', 'y0', 'y1', 'x0', 'x1']]
def _read_binary_mask(r):
def _read_binary_mask(r):
Loading