A walk with fastai2 - Vision - Study Group and Online Lectures Megathread

https://matplotlib.org/api/_as_gen/matplotlib.pyplot.imshow.html
When using scalar data and no explicit *norm* , *vmin* and *vmax* define the data range that the colormap covers. By default, the colormap covers the complete value range of the supplied data. *vmin* , *vmax* are ignored if the *norm* parameter is used.
Oh yes i rem that png for the mask is very important or else jpeg compression screws thing up.
Something similar was when you resize you should always use nearest neighbour for the masks (currently that is handled with type dispatch).

@harikrishnanrajeev we’ve actually already covered all the concepts needed for SuperRes. Look at the course NB and you’ll see it’s feature loss like we did for style transfer (but with a unet)

https://github.com/fastai/fastai2/blob/master/nbs/course/lesson7-superres.ipynb

1 Like

@muellerzr just saw your interview with Sanyanam yesterday. Would love to follow your course?

1 Like

We’re up to lesson 5 now, you can find all the relevant links to the courses and notebooks on the first post :slight_smile:

2 Likes

@muellerzr i’m looking at 05_Style_Transfer and when i print out
vgg19(pretrained=True).features

there is a relu on layer 8. but it doesn’t look like it’s being used on this line

layers = [feat_net[i] for i in [1, 6, 11, 20, 29, 22]]; layers

and i was wondering if you know why?

@foobar8675 i think it is more of an art than science to this (probably should experiment and see how changing this changes the output, on my todo list)
If you look at the lecture that has been linked, Jeremy suggests using the layer right before any type of pooling layers as they contain the max information at that given grid size. :slight_smile:

2 Likes

One more question, I’m trying to get my head around L or more specifically fastcore.foundation.L. Is there a web page on https://dev.fast.ai/index.html which describes it? I think it was mentioned in one of the lectures, but I can’t find it … and also can not find it in https://dev.fast.ai/torch_core :frowning:

Have you tried doing L?? and scroll down to the bottom you should find the location
/usr/local/lib/python3.6/dist-packages/fastcore/foundation.py should be there :slight_smile:

2 Likes

ah, thanks. I knew it was silly question.

not at all, in fact there should be an easier way with show docs showing you a link, let me see if i can find what it is or if some one else can chime in. :slight_smile:

1 Like

I am just going through the lecture now, and saw a question with hooks. what helped me was going to https://dev.fast.ai/callback.hook#What-are-hooks? and pasting the first example into a colab and stepping through it.

from that, my intuition is that the hooks.stored (as used in the notebook) are the input and output parameters. after that, i realized it was pretty much the same as what Zachary said.

parameters are the weights and biases. these are the things the model updates based on the loss.
activations are numbers that are calculated like the output of a matrix multiplication (convolutions) or outputs of a ReLU(or any other activation layer).
SO there is a difference between parameters and activations.
Here hooks are used to grab the activations not the parameters if i’m not wrong

@muellerzr, I am going through the notebook 01_ custom.ipynb in colab. Can you please explain how to do the step: " Create directory and upload URL file into your server". I have two files called covered.txt and uncovered.txt sitting in my laptop which contain the URLs of the images that I need to perform classification on.

Hi vahuja4 hope your having a good day!

Create directory and upload URL file into your server". I have two files called covered.txt and uncovered.txt sitting in my laptop which contain the URLs of the images that I need to perform classification on.

In the folders list you should have covered and uncovered.
In the files list you should have covered.txt and uncovered.txt

When you have created the directory structure you can can drag and drop you you text files to the same directory as the folders and run the remaining cells.

Hope this helps

1 Like

@barnacl can you tell me more about this resizing issue? I believe it must be in the defaults since it is working fine now but I could not find it in the item_tfms

@mrfabulous1, thank you! I tried what you suggested. Please take a look at the error in the screenshot. Everything seems to be in-place, but I am getting this error.

@mgloria it’s in the resize transform:

https://github.com/fastai/fastai2/blob/master/fastai2/vision/augment.py#L192

Specifically in the method you can see we use Image.NEAREST which grabs the pixel nearest the original

2 Likes

The assumption in the notebook is you don’t have the txt files nested in the folders. Since you do you need to point a path to each one of the files too. It thinks they’re all in the base directory (hence not found). The different directory structure is shown in the video.

IE path_f now becomes data/sla/notarp

If you take a look at the screenshot, I am printing the variable path/n and it is pointing to data/sla/tarp, and path_f is tarp.txt. Is that not correct?

They both need it in this case, as the first path is the destination, the second path should point to exactly where our file is stored.

1 Like