Skip to content
Snippets Groups Projects
Commit b257dfe4 authored by Christopher Randolph Rhodes's avatar Christopher Randolph Rhodes
Browse files

Untested create from Bounding boxes

parent 978adaf9
No related branches found
No related tags found
No related merge requests found
......@@ -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:
......
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