Skip to content

Instantly share code, notes, and snippets.

View mohit-kaushik's full-sized avatar
🛰️
Learning with less abstraction

Mohit Kaushik mohit-kaushik

🛰️
Learning with less abstraction
  • Accenture
  • New Delhi
View GitHub Profile
@yinguobing
yinguobing / tfrecord.py
Last active February 21, 2022 03:08
Minimal example writing tfrecord file from a image and it's label.
"""Minimal example showing how to generate TensorFlow TFRecord file."""
import tensorflow as tf
tf.enable_eager_execution()
# All raw values should be converted to a type compatible with tf.Example. Use
# the following functions to do these convertions.
def _bytes_feature(value):
"""Returns a bytes_list from a string / byte."""
@jkatagi
jkatagi / tif_tools.py
Last active April 25, 2023 03:28
Read GeoTiff and convert numpy.array to GeoTiff.
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os.path
import re
from osgeo import gdal
from osgeo import gdal_array
from osgeo import osr