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
+ 18
2
Compare changes
  • Side-by-side
  • Inline
@@ -310,7 +310,24 @@ class RoiSet(object):
return RoiSet(acc_raw, df, params)
# TODO: add or overload for object detection case
# TODO: add a generator for the object detection case
@staticmethod
def from_bounding_boxes(
acc_raw: GenericImageDataAccessor,
yxhw_list: List,
params: RoiSetMetaParams = RoiSetMetaParams()
):
df = pd.DataFrame([
{
'y0': yxhw[0],
'y1': yxhw[0] + yxhw[2],
'x0': yxhw[1],
'x1': yxhw[1] + yxhw[3],
} for yxhw in yxhw_list
])
return RoiSet(acc_raw, df, params)
@staticmethod
def from_binary_mask(
acc_raw: GenericImageDataAccessor,
@@ -705,7 +722,6 @@ class RoiSet(object):
if k == 'annotated_zstacks':
record[k] = str(Path(k) / self.export_annotated_zstack(subdir, prefix=pr, **kp))
if k == 'object_classes':
# for kc, acc in self.object_class_maps.items():
pr = 'classify_by_'
cnames = [c.split(pr)[1] for c in self._df.columns if c.startswith(pr)]
for n in cnames:
Loading