In this article, I will share some of my experience on installing NVIDIA driver and CUDA on Linux OS. Here I mainly use Ubuntu as example. Comments for CentOS/Fedora are also provided as much as I can.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Script for visualising the size comparison between the object and the image to determine accurate anchor sizes | |
""" | |
from PIL import Image | |
import numpy as np | |
img_size = (1024,1024) | |
obj_size = (16,16) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import image_slicer | |
from PIL import Image | |
def parser(): | |
arg_parser = argparse.ArgumentParser('Image Slicer') | |
arg_parser.add_argument('--image', help='Image to be sliced') | |
arg_parser.add_argument('--num_tiles', help='Number of tiles') | |
arg_parser.add_argument('--save_tiles', help="Save tiles",action='store_true') | |
arg_parser.add_argument('--tiles_dir',help="Directory to store tiles",type=str) | |
return arg_parser.parse_args() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import json | |
import matplotlib.pyplot as plt | |
from collections import Counter | |
# For jupyter notebook | |
#%matplotlib inline | |
# TODO: Clean up this code |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding:utf-8 -*- | |
import os | |
import cv2 | |
import json | |
import pprint | |
import numpy as np | |
from PIL import Image | |
category_dict = {'plane': 0, 'ship': 1, 'storage-tank': 2, 'baseball-diamond': 3, 'tennis-court': 4, 'basketball-court': 5, | |
'ground-track-field': 6, 'harbor': 7, 'bridge': 8, 'small-vehicle': 9, 'large-vehicle': 10, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from json import load, dump | |
from argparse import ArgumentParser | |
from re import compile | |
import sys | |
import os | |
parser = ArgumentParser(description="Group (merge) multiple GeoJSON files.") | |
defaults = dict(outfile=sys.stdout) |
1. Rescale specfic bands and write them to output tiff
gdal_translate -ot Byte -b 5 -b 3 -b 2 -scale_1 0 1970 0 255 -scale_2 0 1860 0 255 -scale_3 0 1174 0 255 WV.TIF WV_RGB.TIF
We take bands 5 (red), 3 (green) and 2(blue), scale them to 8 bit range and write it to an output file. Things to note:
a. Output scale by default is 0 to 255, so there's no real reason to specify.
b. Once we pick the bands, they are thereafter referred w.r.t output. This is why we specify `scale_1` to rescale band 5 because band 5 in the input is band 1 of output.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
src_dir = "./Files" | |
dst_dir = "./Result" | |
""" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer