Git Product home page Git Product logo

building-footprint's Introduction

Building Footprint Segmentation

Installation

pip install building-footprint-segmentation

Dataset

Training

Visualize Training

Test images at end of every epoch
Visualizing on Tensorboard
from building_footprint_segmentation.helpers.callbacks import CallbackList, TensorBoardCallback
where_to_log_the_callback = r"path_to_log_callback"   
callbacks = CallbackList()

# Ouptut from all the callbacks caller will be stored at the path specified in log_dir
callbacks.append(TensorBoardCallback(where_to_log_the_callback))

To view Tensorboard dash board

tensorboard --logdir="path_to_log_callback"

Defining Custom Callback

from building_footprint_segmentation.helpers.callbacks import CallbackList, Callback

class CustomCallback(Callback):
    def __init__(self, log_dir):
        super().__init__(log_dir)


where_to_log_the_callback = r"path_to_log_callback"   
callbacks = CallbackList()

# Ouptut from all the callbacks caller will be stored at the path specified in log_dir
callbacks.append(CustomCallback(where_to_log_the_callback))

Split the images in smaller sample

import glob
import os

from image_fragment.fragment import ImageFragment

# FOR .jpg, .png, .jpeg
from imageio import imread, imsave

# FOR .tiff
from tifffile import imread, imsave

ORIGINAL_DIM_OF_IMAGE = (1500, 1500, 3)
CROP_TO_DIM = (384, 384, 3)

image_fragment = ImageFragment.image_fragment_3d(
    fragment_size=(384, 384, 3), org_size=ORIGINAL_DIM_OF_IMAGE
)

IMAGE_DIR = r"pth\to\input\dir"
SAVE_DIR = r"pth\to\save\dir"

for file in glob.glob(
    os.path.join(IMAGE_DIR, "*")
):
    image = imread(file)
    for i, fragment in enumerate(image_fragment):
        # GET DATA THAT BELONGS TO THE FRAGMENT
        fragmented_image = fragment.get_fragment_data(image)

        imsave(
            os.path.join(
                SAVE_DIR,
                f"{i}_{os.path.basename(file)}",
            ),
            fragmented_image,
        )

Inference

Segmentation for building footprint

  • binary
  • building with boundary (multi class segmentation)

Weight File

Refer gtkit for commonly used utility task when working with Geotiff

building-footprint's People

Contributors

confidence9898 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.