DataBlocks API examples

Creating a separate thread which could serve as a megathread and a central repository to share various different examples using the DataBlocks API for various different applications such as images/text/tabular/colab.

We already have this wonderful notebook with some great examples.

Various different DataBlock examples available so far:

Image Classification

  1. (ImageBlock, CategoryBlock) Input: 1-channel image, Output: 1 label
  2. (ImageBlock, CategoryBlock) Input: 3-channel image, Output: 1 label

MultiLabel Image Classification

  1. (ImageBlock, MultiCategoryBlock) Input: 3-channel image, Output: Multiple Labels
    Amazon Planets MultiLabel


  1. (ImageBlock, MaskBlock) Input: 3-channel image, Output: Mask

Image Regression

  1. (ImageBlock, PointBlock) Input: 3-channel image, Output: Multiple Points
    Facial Landmarks
  2. (ImageBlock, RegressionBlock) Input: 3-channel image, Output: 1 Real Number (Age)
    IMDB-WIKI – 500k+ face images with age and gender labels

Object Detection

(ImageBlock, PointBlock) Input: 3-channel image, Output: Multiple Points

  1. COCO


  1. IMDB

Might want to link to nb 50?


@muellerzr already has a datablock for Bengali competition, which we may use as a starting point, and see if we can include some other tips from the winning solutions.


Wow, I didn’t know!


Not sure how we go about arranging all our examples.
I was thinking all in a notebook will make it very long.
At the end of the day in either the documentation section or tutorials we should have Datablock examples for different categories.


1 Like

Was about to say, my repo should have a few creative examples we can put on here, let me check real quick :wink:

Off the top of my head:

  • Style Transfer (ImageBlock, ImageBlock): url It’s different because it’s image to image where you do not have a specification for a y as your input is your labelled output

  • Multi-Keypoint regression (ImageBlock, PointBlock): url bringing in a pure dataframe with 17 different keypoints and formatting it in a way the DataBlock API will accept

  • Multi-Label from single label classes (ImageBlock, MultiCategoryBlock) url

  • Binary segmentation + common pitfalls (very specific about segmentation in general, may not fit well) (ImageBlock, SegmentationBlock)url

  • @barnacl already mentioned the age regression so I won’t mention it again :slight_smile:

Okay @barnacl i’m working my way there stop beating me :wink:


Adding to documentation with explanations would be most useful I think.


The age prediction - Image Regression is also a different one from @muellerzr


We can add explanations to CategoryBlock, TransformBlock, ImageBlock etc and also add multiple examples from the excellent work done by @muellerzr already.

1 Like

Right probably we should convert this to a wiki to add examples at top. for example with the Bengali AI we write a one liner like:
Given an image predict 4 different labels( ImageBlock,CategoryBlock,CategoryBlock,CategoryBlock) (link)[]
Something like that


@muellerzr can make this a wiki for us :slight_smile:

We’re on the exact same wavelength right now, I don’t know how we managed that

1 Like

Can I? I suppose so, it’s done :wink:

1 Like

haha didn’t meant to (or did i :smiley: ). Just had your AMAZING repo open :slight_smile: (this videolectureusc btw on youtube who was bugging you with questions as usual :rofl: ) Have to checkout the permutation importance stuff


Okay, now that this is a wiki, peeps spread out and get to work and let’s bring back multiple examples haha

I will get to humback whale competition then.

Just edited my above post with the format you asked, for, feel free to copy and paste, I need to get back to that blog homework :wink:


Thanks. See ya later!

One example to get creative minds thinking is a DataBlock example that combines (and needs to combine): get_x, get_y, and get_items. Just FFT, I’ll return to this later if there’s questions :wink:

FYI, simply passing in TransformBlock() used to be how to do regression, but now we have RegressionBlock() :wink: (thag could be a good example of whats different between the base class (TransformBlock) and the RegressionBlock

It’s come to my attention that the ImageBlock is no longer available under TransformBlock. Is it being renamed or deleted accidentally?