DataBlocks API examples

It is available under vision.data

1 Like

I had problem to from fastai2.vision.all import *. I found the Git issue below.

And then, I looked up in PyTorch forum and applied both pip install six --upgrade and conda install -c anaconda six commends (of course, one at a time). But, the import error persists. Any one can help me? My fastcore is version 1.17.14 and I also upgaded fastai2.

Edit: Eventually, I rebuilt the environment. Then, I could run the import statement properly. Please let me know what is the better way to do it. Thanks in advance.

HI @muellerzr . I am trying to use multi label from single label classes where the labels simply come from the parent folder name. I reused what you have created in the notebook above:

DataBlock(
blocks = (ImageBlock,MultiCategoryBlock),
get_items = get_image_files,
splitter = RandomSplitter(valid_pct =0.3,seed= 42),
get_y = Pipeline([parent_label,multi_l]),
item_tfms = RandomResizedCrop(224,min_scale=0.3),
batch_tfms = aug_transforms(mult=2))

But I am getting the error

TypeError: β€˜<’ not supported between instances of β€˜int’ and β€˜L’

Any pointers to what I am doing wrong?

Hi
Is there an example related to multiple input - multiple output, where the input would be image and its metadata. The images in question is DICOM and I’m having difficulty in figuring out how to go about it.

Added more details here: Medical Imaging | DataBlock for DICOM metadata

Hi,
What datablock structure would be suitable for an input image and target being variable number of points. I am looking at detecting defects in a finished product. There can be zero or any number of defects. Will PointBlock be suitable for this purpose?

1 Like