Skip to content

Instantly share code, notes, and snippets.

View dkurt's full-sized avatar

Dmitry Kurtaev dkurt

View GitHub Profile
@dkurt
dkurt / CMakeLists.txt
Last active August 6, 2024 07:32
OpenVINO asynchronous C++ example
cmake_minimum_required(VERSION 3.4.3)
project(sample CXX)
find_package(InferenceEngine REQUIRED)
add_executable(${CMAKE_PROJECT_NAME} main.cpp)
target_compile_features(${CMAKE_PROJECT_NAME} PRIVATE cxx_range_for)
target_link_libraries(${CMAKE_PROJECT_NAME}
date value
2020-10-05 18:38:10.268021 59
2020-10-05 18:43:10.119784 59
2020-10-05 18:48:09.965870 58
2020-10-05 18:53:09.808872 58
2020-10-05 18:58:09.648668 58
2020-10-05 19:03:09.487420 58
2020-10-05 19:08:09.327250 58
2020-10-05 19:13:09.167299 57
2020-10-05 19:18:09.007362 57
@dkurt
dkurt / rpi
Last active July 30, 2020 10:48
# docker build raspberry_pi -t vineyard_rpi --build-arg http_proxy=$http_proxy --build-arg https_proxy=$https_proxy
# docker run -v $(pwd):/mnt vineyard_rpi cp opencv.tar.gz /mnt
FROM debian:buster
RUN dpkg --add-architecture armhf && \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
crossbuild-essential-armhf \
git \
import numpy as np
import cv2 as cv
import tensorflow as tf
img = cv.imread('img1.jpg')
img = np.ascontiguousarray(img[:,:,[2, 1, 0]])
resized_img = cv.resize(img, (640, 640))
#
# Run TensorFlow
@dkurt
dkurt / opencv_for_android_studio.md
Last active April 9, 2023 00:02
OpenCV for Android Studio
import tensorflow as tf
from tensorflow.python.tools import optimize_for_inference_lib
pb_file = 'resnet_v2_101_299_frozen.pb'
graph_def = tf.compat.v1.GraphDef()
try:
with tf.io.gfile.GFile(pb_file, 'rb') as f:
graph_def.ParseFromString(f.read())
except:
// g++ main.cpp -o out && ./out
#include <stdio.h>
class Counter {
public:
Counter() : i(0) {}
int next() {
i += 1;
from math import ceil
d = 2
h = 3
w = 4
scale_d = 3
scale_h = 3
scale_w = 2
c = 3
curl -o GPG-PUB-KEY-INTEL-OPENVINO-2020 https://apt.repos.intel.com/openvino/2020/GPG-PUB-KEY-INTEL-OPENVINO-2020
apt-key add GPG-PUB-KEY-INTEL-OPENVINO-2020
echo "deb https://apt.repos.intel.com/openvino/2020 all main" | tee - a /etc/apt/sources.list.d/intel-openvino-2020.list
apt-get update
apt-get install -y --no-install-recommends intel-openvino-dev-ubuntu18
node {
name: "normalized_input_image_tensor"
op: "Placeholder"
attr {
key: "dtype"
value {
type: DT_FLOAT
}
}
attr {