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
Train | |
./darknet detector train data/obj.data cfg/obj.cfg darknet53.conv.74 -map | |
Test | |
./darknet detector test data/obj.data cfg/obj.cfg backup/obj_last.weights | |
Test Multiple from test.txt | |
./darknet detector test data/obj.data cfg/obj.cfg backup/obj_6000.weights -i 0 -thresh 0.25 -dont_show -ext_output < data/obj/test.txt > detected.txt | |
Test C++ |
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 | |
cap = cv2.VideoCapture("test.MP4") | |
out = cv2.VideoWriter('out.mp4', 0x7634706d, 20.0, (960,540)) | |
if (cap.isOpened()==False): | |
print("Error reading video") | |
while (cap.isOpened()): |
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
/* | |
Terminal gstreamer pipeline | |
GoPro - UVC | |
gst-launch-1.0 v4l2src device="/dev/video1" ! "video/x-raw,width=1920,height=1080,format=YUY2" ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvvidconv ! xvimagesink | |
E-cons camera | |
gst-launch-1.0 v4l2src device="/dev/video1" ! "video/x-raw,width=1920,height=1080,format=UYVY" ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12' ! nvoverlaysink | |
Jetson on board camera |
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 <iostream> | |
#include <iomanip> | |
#include <string> | |
#include <vector> | |
#include <queue> | |
#include <fstream> | |
#include <thread> | |
#include <future> | |
#include <atomic> | |
#include <mutex> // std::mutex, std::unique_lock |
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
#pragma once | |
#include "CommonDef.h" | |
#include "Utils.h" | |
#include <string> | |
typedef std::pair<string, float> Prediction; | |
class ClassificationWithIntelContext; | |
class ClassificationWithIntel { |
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 "ClassificationWithIntel.h" | |
#include "IntelClassification.h" | |
using namespace IntelVINOLib; | |
class ClassificationWithIntelContext | |
{ | |
public: | |
ClassificationWithIntelContext() {} | |
~ClassificationWithIntelContext() {} |
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 sys | |
import os | |
from google.cloud import automl_v1beta1 | |
from google.cloud.automl_v1beta1.proto import service_pb2 | |
def get_prediction(content, project_id, model_id): | |
prediction_client = automl_v1beta1.PredictionServiceClient() |
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] | |
files_dict = dict(zip(data_folders, filenames)) | |
base_gcs_path = 'gs://sunlit-cove-237107-vcm/Damage/' |
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 | |
cap = cv2.VideoCapture('test.mp4') | |
#cap = cv2.VideoCapture(0) #tried using webcam and works | |
count = 0 | |
while cap.isOpened(): | |
ret,frame = cap.read() | |
cv2.imshow('window-name',frame) | |
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 | |
# Input image | |
input = cv2.imread('0.jpg') | |
# Get input size | |
width, height, _ = input.shape | |
# Desired "pixelated" size | |
w, h = (64, 64) |