From 30f058d6a273fd779034f6880b2ef251d010e7b5 Mon Sep 17 00:00:00 2001 From: Sayantan Das <36279638+ucalyptus@users.noreply.github.com> Date: Tue, 7 Apr 2020 11:09:01 +0530 Subject: [PATCH 1/3] Added Salinas --- datasets.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/datasets.py b/datasets.py index 500941b..5f2554b 100644 --- a/datasets.py +++ b/datasets.py @@ -26,6 +26,12 @@ 'img': 'Pavia.mat', 'gt': 'Pavia_gt.mat' }, + 'Salinas': { + 'urls': ['http://www.ehu.eus/ccwintco/uploads/a/a3/Salinas_corrected.mat', + 'http://www.ehu.eus/ccwintco/uploads/f/fa/Salinas_gt.mat'], + 'img': 'Salinas_corrected.mat', + 'gt': 'Salinas_gt.mat' + }, 'PaviaU': { 'urls': ['http://www.ehu.eus/ccwintco/uploads/e/ee/PaviaU.mat', 'http://www.ehu.eus/ccwintco/uploads/5/50/PaviaU_gt.mat'], @@ -138,6 +144,20 @@ def get_dataset(dataset_name, target_folder="./", datasets=DATASETS_CONFIG): ignored_labels = [0] + + elif dataset_name == 'Salinas': + img = open_file(folder + 'Salinas.mat')['Salinas_corrected'] + + rgb_bands = (43, 21, 11) # AVIRIS sensor + + gt = open_file(folder + 'Salinas_gt.mat')['Salinas_gt'] + + label_values = ['Undefined','Brocoli_green_weeds_1', 'Brocoli_green_weeds_2','Fallow','Fallow_rough_plow','Fallow_smooth','Stubble','Celery', + 'Grapes_untrained','Soil_vinyard_develop','Corn_senesced_green_weeds','Lettuce_romaine_4wk','Lettuce_romaine_5wk','Lettuce_romaine_6wk', + 'Lettuce_romaine_7wk','Vinyard_untrained','Vinyard_vertical_trellis'] + + ignored_labels = [0] + elif dataset_name == 'IndianPines': # Load the image img = open_file(folder + 'Indian_pines_corrected.mat') From 56a7796954eda1f202344cf8c36526e8df7efe59 Mon Sep 17 00:00:00 2001 From: Sayantan Das <36279638+ucalyptus@users.noreply.github.com> Date: Tue, 7 Apr 2020 11:14:06 +0530 Subject: [PATCH 2/3] joblib is now independent of sklearn.externals --- inference.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inference.py b/inference.py index 0bdfe7d..35c026f 100644 --- a/inference.py +++ b/inference.py @@ -1,7 +1,7 @@ # Python 2/3 compatiblity from __future__ import print_function from __future__ import division - +import joblib import os from utils import convert_to_color_, convert_from_color_, get_device from datasets import open_file @@ -91,7 +91,6 @@ def convert_from_color(x): return convert_from_color_(x, palette=invert_palette) if MODEL in ['SVM', 'SVM_grid', 'SGD', 'nearest']: - from sklearn.externals import joblib model = joblib.load(CHECKPOINT) w, h = img.shape[:2] X = img.reshape((w*h, N_BANDS)) From 4367da96ad0be904cd6341231c9654d736a69f03 Mon Sep 17 00:00:00 2001 From: Sayantan Das <36279638+ucalyptus@users.noreply.github.com> Date: Tue, 7 Apr 2020 11:18:29 +0530 Subject: [PATCH 3/3] Added joblib --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index c573d39..5e880aa 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,3 +9,4 @@ scikit-image>=0.13.1 torch>=0.4.0 matplotlib>=2.0.2 torchsummary>=1.5 +joblib==0.14.1