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
train_transforms = transforms.Compose([ | |
transforms.Resize((196, 196)), | |
transforms.RandomChoice([ | |
transforms.ColorJitter(brightness=0.5), | |
transforms.ColorJitter(contrast=0.5), | |
transforms.ColorJitter(saturation=0.5), | |
transforms.ColorJitter(hue=0.5), | |
transforms.ColorJitter(brightness=0.1, contrast=0.1, saturation=0.1, hue=0.1), | |
transforms.ColorJitter(brightness=0.3, contrast=0.3, saturation=0.3, hue=0.3), | |
transforms.ColorJitter(brightness=0.5, contrast=0.5, saturation=0.5, hue=0.5), |
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
train_transforms = transforms.Compose([ | |
transforms.Resize((196, 196)), | |
transforms.RandomChoice([ | |
transforms.ColorJitter(brightness=0.5), | |
transforms.ColorJitter(contrast=0.5), | |
transforms.ColorJitter(saturation=0.5), | |
transforms.ColorJitter(hue=0.5), | |
transforms.ColorJitter(brightness=0.1, contrast=0.1, saturation=0.1, hue=0.1), | |
transforms.ColorJitter(brightness=0.3, contrast=0.3, saturation=0.3, hue=0.3), | |
transforms.ColorJitter(brightness=0.5, contrast=0.5, saturation=0.5, hue=0.5), |
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
train_labels = pd.read_csv(os.path.join(data_dir, 'train_labels.csv')) | |
wsi = pd.read_csv(os.path.join(data_dir, 'patch_id_wsi_full.csv')) | |
wsi_ids = wsi.wsi.values | |
group_kfold = GroupKFold(n_splits=n_splits) | |
for fold_index, (train_index, valid_index) in enumerate(group_kfold.split(train_labels.id, train_labels.label, wsi_ids)): | |
X_train, X_valid = train_labels.id[train_index], train_labels.id[valid_index] | |
y_train, y_valid = train_labels.label[train_index], train_labels.label[valid_index] |
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 os | |
from PIL import Image | |
import matplotlib.pyplot as plt | |
# Basic stats like amount of images, classes balance, image size | |
n_train_images = len(os.listdir('data/train')) | |
n_test_images = len(os.listdir('data/test')) | |
train_imgs = os.listdir("data/train") | |
print('Train/Test images: {}/{}'.format(n_train_images, n_test_images)) |
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 of the model | CV (Fold) | LB (Private Kaggle) | |
---|---|---|---|
SE_ResNet-50 center crop (32 px) | 0.91 | 0.89 | |
SE_ResNet-50 original size (96 px) | 0.96 | 0.95 | |
SE_ResNet-50 resize (196 px) | 0.980 | 0.966 | |
SE_ResNet-50 resize + TTA (196 px + 4TTA) | 0.985 | 0.969 | |
SE_ResNet-50 resize + TTA + folds (196 px + 4TTA + 5 folds) | — | 0.977 | |
previous model + EfficientNet-B3 resize + TTA + folds (224 px + 4TTA + 5 folds) | — | 0.981 |
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 flask import Flask | |
server = Flask(__name__) | |
@server.route('/') | |
def hello_world(): | |
return 'hello world!' | |
if __name__ == '__main__': | |
server.run(host='0.0.0.0', port=8000) |
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 flask import Flask | |
server = Flask(__name__) | |
@server.route('/') | |
def hello_world(): | |
return 'hello world!' |
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 app import server | |
if __name__ == "__main__": | |
server.run(host='0.0.0.0', port=8000) |
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 python:3.6.7 | |
WORKDIR usr/src/flask_app | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
COPY . . |
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 python:3.6.7 | |
WORKDIR usr/src/flask_app | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
COPY . . |
OlderNewer