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 detectron2 | |
from detectron2.utils.logger import setup_logger | |
setup_logger() | |
# import some common libraries | |
import numpy as np | |
import cv2 | |
import random | |
import datetime |
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 simplekml | |
import os | |
from itertools import islice | |
def kml_converter(inputfile,kml): | |
f = open(inputfile,"r") | |
for row in islice(f,1,None): #skip read header | |
data=row.split(",") |
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 matplotlib.pyplot as plt | |
from matplotlib.pyplot import figure | |
figure(num=None, figsize=(45, 6), dpi=80, facecolor='w', edgecolor='k') | |
def process(mypath): | |
cols = [] | |
xlist=[] | |
f= open(mypath,"r") | |
lines = f.readlines() |
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 cv2 | |
import numpy as np | |
import os | |
import sys | |
argc = len(sys.argv) | |
border = 2 | |
basePath = "output_networks/pothole/" | |
if argc > 1: | |
srcName = sys.argv[1] |
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
#include <opencv2/core/core.hpp> | |
#include <opencv2/highgui/highgui.hpp> | |
#include <opencv2/opencv.hpp> | |
#include <tesseract/baseapi.h> | |
#include <leptonica/allheaders.h> | |
std::string extractIntegerFromString(string str) | |
{ | |
std::string result; | |
std::stringstream ss; |
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
int slider_max, slider, displayHeight; | |
int displayWidth = 1900; | |
Mat src1; | |
Mat dst; | |
cv::Rect roi; | |
static void on_trackbar(int, void*) | |
{ | |
roi = cv::Rect(slider, 0, displayWidth, displayHeight); | |
dst = src1(roi); |
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
# Inference in Caffe2 using the ONNX model | |
import caffe2.python.onnx.backend as backend | |
import onnx | |
import torch | |
import torchvision | |
from torchvision.transforms import transforms | |
from PIL import Image | |
import numpy as np | |
# First load the onnx model |
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 pandas as pd | |
data_folders = next(os.walk('.'))[1] | |
filenames = [os.listdir(f) for f in data_folders] | |
test_ratio = 10 | |
files_dict = dict(zip(data_folders, filenames)) | |
base_gcs_path = 'gs://v26/v26-30kinds-augmented-color/' |
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
JetsonTX2 YOLOv3 TENSOR-RT | |
Untar : https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/releases/tag/DS2 | |
Edit deepstream_reference_apps-DS2/Makefile.config | |
- CUDA_VER:=9.0 | |
- PLATFORM:=TEGRA | |
go to sources/apps/trt-yolo , then sudo make && sudo make install | |
copy trt-yolo-app to deepstream_reference_apps-DS2/trt-yolo-app | |
download all files from https://github.com/NVIDIA-AI-IOT/deepstream_reference_apps/blob/master/yolo/prebuild.sh to data/ | |
edit data/test_images.txt |
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 | |
from os import walk, getcwd | |
input_list = [] | |
for file in os.listdir("/home/ivan/darknet/data/objdamage/"): | |
input_list.append(file) | |
for filename in input_list: | |
content = open("/home/ivan/darknet/data/objdamage/"+filename, "r") | |
NewerOlder