Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[skip travis] EG: add example notebook on advanced model techniques #174

Merged
merged 9 commits into from Nov 11, 2021

Conversation

mostafajahanifar
Copy link
Collaborator

@mostafajahanifar mostafajahanifar commented Oct 27, 2021

Adding a new example notebook on semantic segmentation (more generally, model prediction) task where advanced topics are addressed. Particularly, in this notebook we are trying to demonestrate how user can use Tiatoolbox to solve the problems in the following three scenarios:

  • 1. Instead of pretrained models embedded in Tiatoolbox's repsitory, user wants to use your own deep learning model (in Pytorch) in the Tiatoolbox prediction workflow.

  • 2. User's input data is of an exotic form which the Tiatoolbox data stream functionality does not support by default.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@shaneahmed shaneahmed added the documentation Improvements or additions to documentation label Oct 27, 2021
@review-notebook-app
Copy link

review-notebook-app bot commented Nov 5, 2021

View / edit / reply to this conversation on ReviewNB

DavidBAEpstein commented on 2021-11-05T21:29:23Z
----------------------------------------------------------------

Instead of "pass" above, it might be clearer to write "# your code here"

should be inherited from -> should inherit from

be of the following structure -> have the following structure

which has the above structure -> which have the above structure

here we define -> we define here

the same way how a semantic -> the same way that a semantic

kernels on the input image -> kernels to the input image

it can be directly fit in -> it can be directly fitted (your usage may possibly be US English---not sure about this)


mostafajahanifar commented on 2021-11-08T18:09:21Z
----------------------------------------------------------------

I added "# your code here" expression but kept the pass as well, because when there is no code, they should have the "pass" statement at the end.

@review-notebook-app
Copy link

review-notebook-app bot commented Nov 5, 2021

View / edit / reply to this conversation on ReviewNB

DavidBAEpstein commented on 2021-11-05T21:29:23Z
----------------------------------------------------------------

In TIAToolbox, IOSegmentorConfig class -> In TIAToolbox, theIOSegmentorConfig class

configurations as we have done -> configurations, as we have done

cell bellow (for more information on -> cell below. (For more information on


@review-notebook-app
Copy link

review-notebook-app bot commented Nov 5, 2021

View / edit / reply to this conversation on ReviewNB

DavidBAEpstein commented on 2021-11-05T21:29:24Z
----------------------------------------------------------------

through preproc method -> through thepreproc method

your own pretrain classification -> your own pretrained classification

there are some times that you -> sometimes you

in TIAToolbox framework -> in the TIAToolbox framework

an external pretrained -> an externally pretrained

that is not included -> not included

so it would be suitable for TIAToolbox pipeline -> so that it would be suitable for a TIAToolbox pipeline

model class should follow tiatoolbox.models.abc.ModelABC structure ->

the model class should follow thetiatoolbox.models.abc.ModelABC structure


vqdang commented on 2021-11-05T21:58:58Z
----------------------------------------------------------------

In the example bolow > In the example below

@review-notebook-app
Copy link

review-notebook-app bot commented Nov 5, 2021

View / edit / reply to this conversation on ReviewNB

DavidBAEpstein commented on 2021-11-05T21:29:25Z
----------------------------------------------------------------

knowledge from -> knowledge of

The functionality of these functions should be designed based -

The design of these functions should be based

TIAToolbox UNet architecutre -> TIAToolbox UNet architecture

get a clue > get an idea

Anyway, now that -> Now that

can be ultimately -> can ultimately be

applied the external_model on a subset of 4 images from "ImageNet" dataset. ->

applied the external_model to a subset of 4 images from the "ImageNet" dataset.


@review-notebook-app
Copy link

review-notebook-app bot commented Nov 5, 2021

View / edit / reply to this conversation on ReviewNB

DavidBAEpstein commented on 2021-11-05T21:29:25Z
----------------------------------------------------------------

has been predicted rightfully > has been correctly predicted


@review-notebook-app
Copy link

review-notebook-app bot commented Nov 5, 2021

View / edit / reply to this conversation on ReviewNB

DavidBAEpstein commented on 2021-11-05T21:29:26Z
----------------------------------------------------------------

the inference process of multiple WSIs -> the inference process for multiple WSIs

such as provided input -> for example, provided input

has been utilized -> is utilized

supports (a list of supported WSI formats can be found here. ->

supports. A list of supported WSI formats can be found here.

all types of plane images as OpenCv does).->

the same types of plane images as OpenCV.

related to mp_shared_space follow be considered similar to the original function ->

related to mp_shared_space should follow the structure of the original function

you will risk -> you risk

we dont modify

-> we don't modify

and change its source image for reading ->

and uses this information to decide which source image to read

is also being queried from the shared -> is also queried through the shared

using Tiattolbox -> using TIAToolbox

we present this example where -> we present the example below, where

to allow loading a 'multiplex tif' tile, which is not officially supported by TIAToolbox ->

to load a 'multiplex tif' tile, although this is not officially supported by TIAToolbox

define the image reader function -> define an image reader function


@review-notebook-app
Copy link

View / edit / reply to this conversation on ReviewNB

DavidBAEpstein commented on 2021-11-05T21:29:27Z
----------------------------------------------------------------

Line #9.        # here, we create a virtual whole-slide image from the image array, but with a single level.

here we create a virtual whole slide image, with a single level, from the image array


@review-notebook-app
Copy link

review-notebook-app bot commented Nov 5, 2021

View / edit / reply to this conversation on ReviewNB

DavidBAEpstein commented on 2021-11-05T21:29:27Z
----------------------------------------------------------------

Do you want to capitalize XReader? It's all lower case in the code.

based WSIStreamDataset class -> based on theWSIStreamDataset class

Furthermore, we should make sure that XReader, which is our new WSI streaming class, is being used ->

We need to make sure that XReader, our new WSI streaming class, is being used

in this case, get_reader function: -> in this case, theget_reader function is defined as follows:


mostafajahanifar commented on 2021-11-08T18:48:52Z
----------------------------------------------------------------

xreader is a function, on the other hand, XReader is class that uses xreader function.

@review-notebook-app
Copy link

review-notebook-app bot commented Nov 5, 2021

View / edit / reply to this conversation on ReviewNB

DavidBAEpstein commented on 2021-11-05T21:29:28Z
----------------------------------------------------------------

Now we have both -> Now that we have both

can use the in the prediction framework -> can use the prediction framework

section but we will overwrite the forward function so that it returns its own input ->

section.We will overwrite the forward function so that it returns its own input.

(returning model input in the output allows us to check what model is seeing in the input) ->

Returning model input as the output allows us to check what our model sees in the input.


@review-notebook-app
Copy link

review-notebook-app bot commented Nov 5, 2021

View / edit / reply to this conversation on ReviewNB

DavidBAEpstein commented on 2021-11-05T21:29:28Z
----------------------------------------------------------------

Everything is in place, let's instantiate our model, segmentor, ->

Everything is in place. Let's instantiate our model segmentor,

here we predict on -> here we predict from


@review-notebook-app
Copy link

review-notebook-app bot commented Nov 5, 2021

View / edit / reply to this conversation on ReviewNB

DavidBAEpstein commented on 2021-11-05T21:29:29Z
----------------------------------------------------------------

input and output image ->input and output images


Copy link
Contributor

vqdang commented Nov 5, 2021

In the example bolow > In the example below


View entire conversation on ReviewNB

@review-notebook-app
Copy link

review-notebook-app bot commented Nov 5, 2021

View / edit / reply to this conversation on ReviewNB

vqdang commented on 2021-11-05T22:02:03Z
----------------------------------------------------------------

external_model.infer_batch=infer_batch

external_model.preproc_func=preproc_func

external_model.postproc_func=postproc_func

^^^ Fix spacing at =


mostafajahanifar commented on 2021-11-08T18:21:04Z
----------------------------------------------------------------

Sure, dear flake-8 :-p

@review-notebook-app
Copy link

review-notebook-app bot commented Nov 5, 2021

View / edit / reply to this conversation on ReviewNB

vqdang commented on 2021-11-05T22:02:04Z
----------------------------------------------------------------

##2. Dealing with exotic data formats

^^^ vscode headline doesnt work here


Copy link
Collaborator Author

I added "# your code here" expression but kept the pass as well, because when there is no code, they should have the "pass" statement at the end.


View entire conversation on ReviewNB

Copy link
Collaborator Author

Sure, dear flake-8 :-p


View entire conversation on ReviewNB

Copy link
Collaborator Author

xreader is a function, on the other hand, XReader is class that uses xreader function.


View entire conversation on ReviewNB

@codecov
Copy link

codecov bot commented Nov 8, 2021

Codecov Report

Merging #174 (44d13a8) into develop (fe0b04a) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #174   +/-   ##
========================================
  Coverage    99.74%   99.74%           
========================================
  Files           44       44           
  Lines         3540     3540           
  Branches       576      576           
========================================
  Hits          3531     3531           
  Misses           3        3           
  Partials         6        6           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fe0b04a...44d13a8. Read the comment docs.

@shaneahmed shaneahmed merged commit 124ba2b into develop Nov 11, 2021
@shaneahmed shaneahmed deleted the example-advanced branch November 11, 2021 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants