This gist is unofficial. It was created for personal use but have kept it public in case it would be of use to others. This document is not updated regularly and may not reflect the current status of the CUDA backend.
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 requests | |
import numpy as np | |
import matplotlib.pyplot as plt | |
r = requests.get('https://api.covid19india.org/states_daily.json') | |
data = r.json() | |
print(len(data['states_daily'])) |
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
#ifndef CUDA_COMMON_HPP | |
#define CUDA_COMMON_HPP | |
#include <iostream> | |
#include <cuda_runtime.h> | |
#include <cublas_v2.h> | |
#define CHECK_CUDA(cond) check_cuda(cond, __LINE__) |
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
// https://github.com/AlexeyAB/darknet/wiki/How-to-evaluate-accuracy-and-speed-of-YOLOv4 | |
// g++ -I/usr/local/include/opencv4/ main.cpp -lopencv_core -lopencv_imgproc -lopencv_dnn -lopencv_imgcodecs -O3 -std=c++17 -lstdc++fs | |
#include <iostream> | |
#include <queue> | |
#include <iterator> | |
#include <sstream> | |
#include <fstream> | |
#include <iomanip> | |
#include <chrono> |
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 <cuda_runtime.h> | |
#include <random> | |
#include <iostream> | |
struct relu_grad | |
{ | |
__device__ float operator()(float x) { return x > 0; } | |
}; |
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 <cuda_runtime.h> | |
#include <iostream> | |
#include <algorithm> | |
#include <random> | |
__global__ void relu(float* output, const float* input, unsigned int* sign32, int n) | |
{ | |
int i = blockIdx.x * blockDim.x + threadIdx.x; |
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 "mish.hpp" | |
#include <cuda_runtime.h> | |
#include <random> | |
#include <iostream> | |
template <class Activation> | |
__global__ void activate_vec1(float* __restrict__ output, const float* __restrict__ input, int n) | |
{ |
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
g++ -I/usr/local/include/opencv4/ benchmark.cpp -lopencv_core -lopencv_imgproc -lopencv_dnn -lopencv_imgcodecs -O3 -std=c++17 |
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
#!/bin/bash | |
# License: MIT. See license file in root directory | |
# Copyright(c) JetsonHacks (2017-2019) | |
OPENCV_VERSION=4.1.1 | |
# Jetson Nano | |
ARCH_BIN=5.3 | |
INSTALL_DIR=/usr/local | |
# Download the opencv_extras repository | |
# If you are installing the opencv testdata, ie |
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 time | |
CONFIDENCE_THRESHOLD = 0.2 | |
NMS_THRESHOLD = 0.4 | |
COLORS = [(0, 255, 255), (255, 255, 0), (0, 255, 0), (255, 0, 0)] | |
class_names = [] | |
with open("classes.txt", "r") as f: | |
class_names = [cname.strip() for cname in f.readlines()] |
NewerOlder