Coder Social home page Coder Social logo

aeronetlib's Introduction

Aeronet

Python library to work with geospatial raster and vector data.

Modules

.backend

Keras losses (tensorflow backend)

  • .losses
    -- jaccard_loss
    -- bce_jaccard_loss
    -- cce_jaccard_loss
    -- custom_bce_jaccard_loss
  • .metrics
    -- iou_score
    -- f_score
    -- f1_score

.criterions

Metrics to work with spatial data

  • .raster
    -- IoU
    -- mIoU
  • .vector
    -- mAP50/mAP5095/mAPxx - instance-wise metric
    -- area_iou

.dataset

  • .raster
    -- Band/BandCollection
    -- BandSample/BandSampleCollection
  • .vector
    -- Feature/FeatureCollection
  • .transforms
    -- polygonize
    -- rasterize
  • .io
    -- Predictor
    -- WindowReader
    -- SampleWindowWriter
    -- SampleCollectionWindowWriter
  • .visualization
    -- add_mask

Quick start

import os
import matpoltib.pyplpot as plt 

from aeronet.dataset import BandCollection
from aeronet.dataset import RandomDataset

from aeronet.dataset.utils import parse_directory
from aeronet.dataset.visualization import add_mask

# configuration
SRC_DIR = '/path/to/elements/'
channels = ['RED', 'GRN', 'BLU']
labels = ['100']

# directories of dataset elements
dirs = [os.path.join(SRC_DIR, x) for x in os.listdir(SRC_DIR)]
print('Found collections: ', len(dirs), end='\n\n')

# parse channels in directories
band_paths = [parse_direcotry(x, channels + labels) for x in dirs]
print('BandCollection 0 paths:\n', band_paths[0], end='\n\n')

# convert to `BandCollection` objects
band_collections = [BandCollection(fps) for fps in band_paths]
print('BandCollection 0 object:\n', repr(band_collections[0]))


# create random dataset sampler
dataset = RandomDataset(band_collections, 
                        sample_size=(512, 512), 
                        input_channels=channels, 
                        output_labels=labels,
                        transform=None) # pre-processing function
                        
# get random sample
generated_sample = dataset[0]
image = generated_sample['image']
mask = generated_sample['mask']

#visualize
masked_image = add_mask(image, mask)

plt.figure(figsize=(10,10))
plt.imshow(masked_image)
plt.show()                    

aeronetlib's People

Contributors

alexeytrekin avatar godnik avatar qubvel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.