Skip to content

Commit

Permalink
fix uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
zdaiot committed Sep 29, 2019
1 parent 12170d9 commit b1d2a30
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 13 deletions.
8 changes: 4 additions & 4 deletions create_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
if kaggle:
os.system('pip install /kaggle/input/segmentation-models/pretrainedmodels-0.7.4/ > /dev/null')
os.system('pip install /kaggle/input/segmentation-models/segmentation_models.pytorch/ > /dev/null')
package_path = 'kaggle/input/sources' # add unet script dataset
package_path = '/kaggle/input/sources' # add unet script dataset
import sys
sys.path.append(package_path)
from datasets.steel_dataset import TestDataset
Expand Down Expand Up @@ -82,9 +82,9 @@ def create_submission(n_splits, model_name, batch_size, num_workers, mean, std,
n_splits = [1] # [0, 1, 2, 3, 4]

if kaggle:
sample_submission_path = 'kaggel/input/severstal-steel-defect-detection/sample_submission.csv'
test_data_folder = "kaggle/input/severstal-steel-defect-detection/test_images"
model_path = 'kaggle/input/checkpoints'
sample_submission_path = '/kaggle/input/severstal-steel-defect-detection/sample_submission.csv'
test_data_folder = "/kaggle/input/severstal-steel-defect-detection/test_images"
model_path = '/kaggle/input/checkpoints'
else:
sample_submission_path = 'datasets/Steel_data/sample_submission.csv'
test_data_folder = 'datasets/Steel_data/test_images'
Expand Down
1 change: 0 additions & 1 deletion datasets/steel_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from utils.data_augmentation import data_augmentation
from utils.rle_parse import mask2rle, make_mask
from utils.visualize import image_with_mask_torch
import pickle
warnings.filterwarnings("ignore")


Expand Down
4 changes: 4 additions & 0 deletions uploads.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ if [ ! -d "kaggle" ]; then
mkdir -p kaggle/sources
mkdir -p kaggle/sources/models
mkdir -p kaggle/sources/datasets
mkdir -p kaggle/sources/utils
mkdir -p kaggle/checkpoints
mkdir -p kaggle/submission
mkdir -p kaggle/segmentation_models
Expand All @@ -28,6 +29,9 @@ cp models/model.py kaggle/sources/models
cp datasets/steel_dataset.py kaggle/sources/datasets
cp solver.py kaggle/sources
cp classify_segment.py kaggle/sources
cp utils/data_augmentation.py kaggle/sources/utils
cp utils/rle_parse.py kaggle/sources/utils
cp utils/visualize.py kaggle/sources/utils

# 复制权重文件
cp checkpoints/$model_name/*_best.pth kaggle/checkpoints
Expand Down
5 changes: 0 additions & 5 deletions utils/data_augmentation.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import numpy as np
import cv2
import random
import glob
from matplotlib import pyplot as plt
from PIL import Image
import pandas as pd
from tqdm import tqdm
import sys
import os
from copy import deepcopy
Expand Down
1 change: 0 additions & 1 deletion utils/rle_parse.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy as np
import pandas as pd


# https://www.kaggle.com/paulorzp/rle-functions-run-lenght-encode-decode
Expand Down
2 changes: 0 additions & 2 deletions utils/visualize.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# 可视化操作
import cv2
import torch
from PIL import Image
import numpy as np


Expand Down

0 comments on commit b1d2a30

Please sign in to comment.