Skip to content

Commit

Permalink
Closes #19, closes #21. Folder deepleeo created. Module datasetGen re…
Browse files Browse the repository at this point in the history
…named. Tests fixed.
  • Loading branch information
Raian Vargas Maretto committed Jun 22, 2018
1 parent fb675df commit 0c1e873
Show file tree
Hide file tree
Showing 16 changed files with 130 additions and 219 deletions.
32 changes: 32 additions & 0 deletions notebooks/first_classification.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
93 changes: 61 additions & 32 deletions notebooks/generate_samples_one_scene.ipynb

Large diffs are not rendered by default.

58 changes: 26 additions & 32 deletions notebooks/plot_preprocessor_results.ipynb

Large diffs are not rendered by default.

144 changes: 0 additions & 144 deletions src/datasetGen/sampleGenerator_old.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ def save_labeled_raster_to_gtiff(self, path_tiff):
output_ds.SetProjection(self.base_raster.GetProjection())
output_ds.SetGeoTransform(self.base_raster.GetGeoTransform())
output_band = output_ds.GetRasterBand(1)
output_band.WriteArray(np.ma.filled(self.labeled_raster, self.nodata_val))
output_band.WriteArray(np.ma.filled(self.labeled_raster[:,:,0], self.nodata_val))
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from osgeo import ogr
from osgeo import osr #TODO: Verify if it is really necessary? If I get the SRID from the Raster I still need this?

sys.path.insert(0, "../")
sys.path.insert(0, os.path.join(os.path.dirname(__file__),"../"))
import utils.filesystem as fs

class SampleGenerator(object):
Expand Down Expand Up @@ -69,9 +69,9 @@ def save_samples_PNG(self, path, colorMap=None, r_g_b=[1,2,3]):
fileName = "sample" + str(pos) + ".png"
scipy.misc.imsave(os.path.join(samplesDir, fileName), self.samples_img[pos][:, :, r_g_b])
if(colorMap is None):
scipy.misc.imsave(os.path.join(labelsDir, fileName), self.samples_labels[pos])
scipy.misc.imsave(os.path.join(labelsDir, fileName), self.samples_labels[pos][:,:,0])
else:
pl.imsave(fname=os.path.join(labelsDir, fileName), arr=self.samples_labels[pos], cmap=colorMap)
pl.imsave(fname=os.path.join(labelsDir, fileName), arr=self.samples_labels[pos][:,:,0], cmap=colorMap)

def save_samples_NPZ(self, path, noDataValue=255):
if os.path.exists(path):
Expand Down
Empty file added src/deepleeo/utils/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import warnings

sys.path.insert(0, path.join(path.dirname(__file__),"../../src"))
import datasetGen.preprocessor as prep
import utils.filesystem as fs
import deepleeo.dataset.preprocessor as prep
import deepleeo.utils.filesystem as fs

# TODO: Improve these tests to compare numerically the results

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import sys

sys.path.insert(0, path.join(path.dirname(__file__),"../../src"))
from datasetGen import rasterizer
import utils.filesystem as fs
from deepleeo.dataset import rasterizer
import deepleeo.utils.filesystem as fs

# TODO: Improve these tests to compare numerically the results

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from matplotlib.colors import ListedColormap

sys.path.insert(0, path.join(path.dirname(__file__),"../../src"))
from datasetGen import rasterizer as rstzr
import datasetGen.sampleGenerator as sg
import utils.filesystem as fs
import deepleeo.dataset.rasterizer as rstzr
import deepleeo.dataset.sampleGenerator as sg
import deepleeo.utils.filesystem as fs

# TODO: Create a method rasterizer.execute, that execute the whole proccess.
class TestSampleGenerator():
Expand Down

0 comments on commit 0c1e873

Please sign in to comment.