Approaches to modeling terrain and maps in python

Overview

topography 🌎

Python 3.8 Build Status Language grade: Python Total alerts

Contains different approaches to modeling terrain and topographic-style maps in python

image

Features

Inverse Distance Weighting (IDW)

A given point P(x, y) is determined by the values of its neighbors, inversely proportional to the distance of each neighbor.

P is more heavily influenced by nearer points via a weighting function w(x, y).

Steps

The value of P(x, y) is determined only by the closest raw data point.

This approach works best to get a "feel" for larger datasets. With few input points, the resulting map has little detail.

In the case of multiple equidistant points being closest, point values are stored, and averaged.

Bilinear

in progress 👷 🛠️

Bicubic

in progress 👷 🛠️

Install

pip install topography

Requirements

  • numpy
  • matplotlib

see the requirements.txt

Example

from topography.Map import Map
from topography.utils.io import getPointValuesFromCsv

# # make map from noise data
# noiseMaker = Noise((0, 50), (0, 50))
# noiseData = noiseMaker.getRandom(scaleFactor=1)
# M = Map(noiseData)

# make map from recorded data
rawData = getPointValuesFromCsv("tests/data/20x20.csv")
M = Map(rawData)

# # Display the inputted raw data values
M.showRawPointValues()

# interpolate the Map
M.idw(showWhenDone=True)

# Display the interpolated data values
M.showFilledPointValues()

# Save the data to a .csv file
# optionally, write to file as a matrix
# default is x, y, z
M.writeLastToCsv("idw_20x20", writeAsMatrix=True)
Comments
  • NN - Improvements and Possible Design Changes

    NN - Improvements and Possible Design Changes

    NN Improvements and Design Changes

    Consider breaking up the current implementation of NN

    • [x] current NN ➡️ Map.steps()
    • [ ] new NN via voroni tesselation ➡️ Map.voroni() or Map.nn()

    image

    feature 
    opened by XDwightsBeetsX 1
  • Noise Generation

    Noise Generation

    Add Noise Generators

    This will be nice for quickly making cool topography maps

    start with random noise, but ideas for later...

    feature 
    opened by XDwightsBeetsX 1
  • allows for user to input map size

    allows for user to input map size

    Custom Map Dimensions, closes #5

    Can now customize views of the Map by specifying a custom Map(rawData, xRange=(lower, upper), yRange=(lower, upper))

    This does not impact the determination of points by interpolation, but does give a "sliced" view of the Map

    feature 
    opened by XDwightsBeetsX 1
  • Add Surface Plotting

    Add Surface Plotting

    New Surface Plot

    • In addition to the heatmap-style plot, add a surface representation plot of the Map
    • It should be displayed alongside the 2D Heatmap in a horizontal subplot
    • This may require some refactoring of the Map PointValue storage so that it can be used as a series of X, Y, Z lists
    • See this documentation on matplotlib

    Something Like This:

    | image | image | | :-: | :-: |

    feature 
    opened by XDwightsBeetsX 1
  • IDW Improvement - Neighborhooding

    IDW Improvement - Neighborhooding

    Add Neighborhooding to IDW

    • only apply IDW to a minimum number of nearby neighbors
      • the point of interest is more likely to be similar to nearby points
    feature 
    opened by XDwightsBeetsX 0
  • Added NN Interpolation

    Added NN Interpolation

    New NN Interpolation

    This is going to work better with larger data sets to get a "feel" for the Map.

    • Should add some noise generator to see how this looks with larger data sets.
    • Also add some docs, mentioning above
    • can add sophistication by grouping within a nearby region
    feature 
    opened by XDwightsBeetsX 0
  • Allow User to Input Map Size

    Allow User to Input Map Size

    Currently

    The size of the Map is determined by the user input RawData:

    width = self.xMax - self.xMin + 1
    height = self.yMax - self.yMin + 1
    

    Desired

    This should be changed to allow for the Instantiation of a Map's size to be set in the constructor.

    • Something like Map(rawData, xRange=(lower, upper), yRange=(lower, upper)) where lower and upper are inclusive
    • This change will have to be accounted for when finding max values
    • Undecided on if interpolation approaches should still consider these points
    feature 
    opened by XDwightsBeetsX 0
  • Bicubic Interpolation

    Bicubic Interpolation

    Add Bicubic Interpolation Scheme

    • [ ] in interpolaion.py add bicubic(thisPt, rawPts)
    • [ ] in tests/test_interpolate add test_bicubic.py
    • [ ] in tests/visual/1d add test_visual_bicubic.py
    • [ ] in Map.py add Map.bicubic(showWhenDone=True)

    image

    also see wikipedia

    feature tests 
    opened by XDwightsBeetsX 0
  • Bilinear Interpolation

    Bilinear Interpolation

    Add Bilinear Interpolation Scheme

    • [ ] in interpolaion.py add bilinear(thisPt, rawPts)
    • [ ] in tests/test_interpolate add test_bilinear.py
    • [ ] in tests/visual/1d add test_visual_bilinear.py
    • [ ] in Map.py add Map.bilinear(showWhenDone=True)

    image

    also see wikipedia

    feature tests 
    opened by XDwightsBeetsX 3
Releases(1.0.0)
  • 1.0.0(Jun 27, 2021)

    check out the new topography package on pypi 🌎

    This package provides some visualization and interpolation for topography data using the Map data structure

    • read data from file into PointValues using topography.utils.io.getPointValuesFromCsv(filename)
    • make a map with M = Map(rawData) and perform some interpolation like Map.idw(showWhenDone=True)
    • write the results to a data file with M.writeLastToCsv("cool_idw_interpolation", writeAsMatrix=True)

    Current interpolation schemes:

    • inverse distance weighting
    • step function
    Source code(tar.gz)
    Source code(zip)
Owner
John Gutierrez
Texas A&M MEEN '22. CS minor. Texas Water Safari Finisher '19 '21
John Gutierrez
Evaluating Privacy-Preserving Machine Learning in Critical Infrastructures: A Case Study on Time-Series Classification

PPML-TSA This repository provides all code necessary to reproduce the results reported in our paper Evaluating Privacy-Preserving Machine Learning in

Dominik 1 Mar 08, 2022
Semi-Supervised Semantic Segmentation with Pixel-Level Contrastive Learning from a Class-wise Memory Bank

This repository provides the official code for replicating experiments from the paper: Semi-Supervised Semantic Segmentation with Pixel-Level Contrast

Iñigo Alonso Ruiz 58 Dec 15, 2022
Distributing Deep Learning Hyperparameter Tuning for 3D Medical Image Segmentation

DistMIS Distributing Deep Learning Hyperparameter Tuning for 3D Medical Image Segmentation. DistriMIS Distributing Deep Learning Hyperparameter Tuning

HiEST 2 Sep 09, 2022
Dense Contrastive Learning (DenseCL) for self-supervised representation learning, CVPR 2021.

Dense Contrastive Learning for Self-Supervised Visual Pre-Training This project hosts the code for implementing the DenseCL algorithm for se

Xinlong Wang 491 Jan 03, 2023
Convert dog pictures into various painting styles. Try LimnPet

LimnPet Cartoon stylization service project Try our service » Home page · Team notion · Members 목차 프로젝트 소개 프로젝트 목표 사용한 기술스택과 수행도구 팀원 구현 기능 주요 기능 추가 기능

LiJell 7 Jul 14, 2022
Indices Matter: Learning to Index for Deep Image Matting

IndexNet Matting This repository includes the official implementation of IndexNet Matting for deep image matting, presented in our paper: Indices Matt

Hao Lu 357 Nov 26, 2022
Face and other object detection using OpenCV and ML Yolo

Object-and-Face-Detection-Using-Yolo- Opencv and YOLO object and face detection is implemented. You only look once (YOLO) is a state-of-the-art, real-

Happy N. Monday 3 Feb 15, 2022
Transformers provides thousands of pretrained models to perform tasks on different modalities such as text, vision, and audio.

English | 简体中文 | 繁體中文 | 한국어 State-of-the-art Machine Learning for JAX, PyTorch and TensorFlow 🤗 Transformers provides thousands of pretrained models

Clara Meister 50 Nov 12, 2022
Sequence to Sequence Models with PyTorch

Sequence to Sequence models with PyTorch This repository contains implementations of Sequence to Sequence (Seq2Seq) models in PyTorch At present it ha

Sandeep Subramanian 708 Dec 19, 2022
NeRF Meta-Learning with PyTorch

NeRF Meta Learning With PyTorch nerf-meta is a PyTorch re-implementation of NeRF experiments from the paper "Learned Initializations for Optimizing Co

Sanowar Raihan 78 Dec 18, 2022
Why Are You Weird? Infusing Interpretability in Isolation Forest for Anomaly Detection

Why, hello there! This is the supporting notebook for the research paper — Why Are You Weird? Infusing Interpretability in Isolation Forest for Anomal

2 Dec 14, 2021
METS/ALTO OCR enhancing tool by the National Library of Luxembourg (BnL)

Nautilus-OCR The National Library of Luxembourg (BnL) started its first initiative in digitizing newspapers, with layout recognition and OCR on articl

National Library of Luxembourg 36 Dec 05, 2022
Randstad Artificial Intelligence Challenge (powered by VGEN). Soluzione proposta da Stefano Fiorucci (anakin87) - primo classificato

Randstad Artificial Intelligence Challenge (powered by VGEN) Soluzione proposta da Stefano Fiorucci (anakin87) - primo classificato Struttura director

Stefano Fiorucci 1 Nov 13, 2021
Array Camera Ptychography

Array Camera Ptychography This repository provides the code for the following papers: Schulz, Timothy J., David J. Brady, and Chengyu Wang. "Photon-li

Brady lab in Optical Sciences 1 Nov 15, 2021
The Face Mask recognition system uses AI technology to detect the person with or without a mask.

Face Mask Detection Face Mask Detection system built with OpenCV, Keras/TensorFlow using Deep Learning and Computer Vision concepts in order to detect

Rohan Kasabe 4 Apr 05, 2022
Wind Speed Prediction using LSTMs in PyTorch

Implementation of Deep-Forecast using PyTorch Deep Forecast: Deep Learning-based Spatio-Temporal Forecasting Adapted from original implementation Setu

Onur Kaplan 151 Dec 14, 2022
[WACV 2020] Reducing Footskate in Human Motion Reconstruction with Ground Contact Constraints

Reducing Footskate in Human Motion Reconstruction with Ground Contact Constraints Official implementation for Reducing Footskate in Human Motion Recon

Virginia Tech Vision and Learning Lab 38 Nov 01, 2022
A hybrid framework (neural mass model + ML) for SC-to-FC prediction

The current workflow simulates brain functional connectivity (FC) from structural connectivity (SC) with a neural mass model. Gradient descent is applied to optimize the parameters in the neural mass

Yilin Liu 1 Jan 26, 2022
EXplainable Artificial Intelligence (XAI)

EXplainable Artificial Intelligence (XAI) This repository includes the codes for different projects on eXplainable Artificial Intelligence (XAI) by th

4 Nov 28, 2022
Wider or Deeper: Revisiting the ResNet Model for Visual Recognition

ademxapp Visual applications by the University of Adelaide In designing our Model A, we did not over-optimize its structure for efficiency unless it w

Zifeng Wu 338 Dec 12, 2022