This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install software-properties-common | |
sudo add-apt-repository ppa:jonathonf/python-3.6 | |
sudo apt-get update | |
sudo apt-get install python3.6 libpython3.6 | |
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 2 | |
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 | |
sudo rm /usr/bin/python3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collections of scripts harvested mainly from Pete, but also picked up from the forums | |
If you are starting with 0.2.0m4+ START HERE: https://petebankhead.github.io/qupath/2019/08/21/scripting-in-v020.html | |
TOC | |
Access objects in other project images.groovy - in later versions of 0.2.0M#, access the hierarchies of other images | |
Access other project images or data.groovy | |
Access project metadata.groovy - interact with user defined, per image metadata. Useful for sorting projects. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collections of scripts harvested mainly from Pete, but also picked up from the forums | |
TOC | |
Accessing dynamic measurements.groovy - Most annotation measurements are dynamically created when you click on the annotation, and | |
are not accessible through the standard getMeasurement function. This is a way around that. | |
Affine transformation.groovy - access more accurate measurements for the affine transformation used in the image alignment (m5/m6+) | |
Alignment of local cells.groovy - check neighborhood for similarly aligned cells |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collections of scripts harvested mainly from Pete, but also picked up from the forums | |
TOC | |
Annotation subtraction example.groovy - An example of creating and subtracing ROIs through scripting | |
Create annotation of fixed size.groovy - see https://petebankhead.github.io/qupath/scripting/2018/03/09/script-create-fixed-size-region.html | |
Create object based on Viewer position.groovy - Creates an object at the Viewer position. In this case a rectangle. Useful if you want | |
to create the exact same size object multiple times and then move it to an area of interest for subsampling. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scripts mostly taken from Pete, and also from the forums. For easy access and reference. | |
Covers both Selecting, which is necessary to run most commands like cell detection, and collecting objects into a variable | |
for processing. The latter is more efficient when you do not need to run a command like cell detection. | |
TOC | |
A Selection guide.groovy - not actually a script, just a collection of useful tips. | |
Access top level objects.groovy - Creates a list of all objects at the "top" of the hierarchy. This list is dynamic. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Scripts mostly taken from Pete, and also from the forums. For easy access and reference. | |
TOC | |
Alignment: Several scripts to assist in alignment as of M9. Store scripts make files using the Affine transformation while | |
TransferObjects uses the stored file in the Affine folder with the current image name to move objects into it. | |
The final result is that one set of files can be generated for the transforms, and those transforms can be accessed to move objects | |
back and forth between the images. | |
Change annotations into Cell objects.groovy - Converts annotations into PathCellObjects, which allows certian functions to work within |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from the guide https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html | |
# and from other resources found, trying to achieve a good classifier based on Inveption V3 pre-trained netfork | |
from keras.applications.inception_v3 import InceptionV3 | |
from keras.preprocessing import image | |
from keras.models import Model | |
from keras.layers import Dense, GlobalAveragePooling2D | |
from keras.preprocessing.image import ImageDataGenerator | |
from keras import backend as K | |
from keras.callbacks import ModelCheckpoint |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import keras | |
from keras.applications.vgg16 import VGG16 | |
from keras.applications.vgg16 import preprocess_input, decode_predictions | |
from keras.preprocessing import image | |
import keras.backend as K | |
import tensorflow as tf | |
from tensorflow.python.framework import ops | |
import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f1_loss(y_true:torch.Tensor, y_pred:torch.Tensor, is_training=False) -> torch.Tensor: | |
'''Calculate F1 score. Can work with gpu tensors | |
The original implmentation is written by Michal Haltuf on Kaggle. | |
Returns | |
------- | |
torch.Tensor | |
`ndim` == 1. 0 <= val <= 1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
build_web: |