I migrated my gist to my website:
- WebSite
https://unbinilium.github.io/
#pragma once | |
#include <hailo/hailort.hpp> | |
#include <chrono> | |
#include <future> | |
#include <iostream> | |
#include <mutex> | |
#include <string> | |
#include <string_view> |
#pragma once | |
#include <string> | |
#include <vector> | |
#include <utility> | |
#include <torch/torch.h> | |
#include <torch/script.h> | |
#include <opencv2/core.hpp> |
#!/usr/bin/env python3 | |
import os, argparse, secrets | |
import numpy as np | |
from array import * | |
from pathlib import Path | |
from PIL import Image | |
def data_2_mnist(data_folder:Path, img_size:int, output_folder:Path): | |
print("Dataset folder ->", data_folder) |
#pragma once | |
#include <algorithm> | |
#include <string> | |
#include <utility> | |
#include <vector> | |
#include <opencv2/core.hpp> | |
#include <opencv2/dnn.hpp> | |
#include <opencv2/imgproc.hpp> |
I migrated my gist to my website:
https://unbinilium.github.io/
sudo apt-get install -y libopenblas-dev libblas-dev m4 cmake cython python3-dev python3-yaml python3-setuptools libavutil-dev libavcodec-dev libavformat-dev libswscale-dev
git clone --recursive https://github.com/pytorch/pytorch
pushd pytorch
git submodule update --remote third_party/protobuf
As the death toll from the Wuhan coronavirus still risen, I felt anxious and helpless through everyone here were talking and laughing on New Year's Eve. Not sure what should I do and I just wrote this python3 program to make people aware of the importance of wearing respirator masks when defeating the virus.
In this program, we use CascadeClassifier
to add respirators masks to the recognized faces in the capture. Before everything start, we have to import the necessary packages:
import argparse
import cv2
We use argparse
to construct the argument parse for more flexible usage. The respirator image cloud be found on eBay, Google... and transparent background required as .png
format. The haarcascade_frontalface_default.xml
could be found at OpenCV official git repository https://github.com/opencv/opencv/tree/master/data/haarcascade
.
First your OpenCV should be compiled with CUDA (and OpenGL) support to test all this features. Detect your CUDA hardware with OpenCV CUDA by:
#include <iostream>
using namespace std;
#include <opencv2/core.hpp>
using namespace cv;
#include <opencv2/cudaarithm.hpp>
using namespace cv::cuda;
OpenCV is a library of programming functions mainly aimed at real-time computer vision and it officially compiled without support for NVIDIA CUDA, INTEL TTB and OpenCL library, that's why we need to rebuild OpenCV with a custom configuration manually.
CUDA is a parallel computing platform and programming model developed by Nvidia for general computing on its own GPUs (graphics processing units). CUDA enables developers to speed up compute-intensive applications by harnessing the power of GPUs for the parallelizable part of the computation.
Intel TBB (Threading Building Blocks) makes parallel performance and scalability accessible to software developers who are writing loop- and task-based applications. Build robust applications that abstract platform details and threading mechanisms while achieving performance that scales with increasing core count.