Skip to content

Instantly share code, notes, and snippets.

View uelordi01's full-sized avatar

Unai uelordi01

View GitHub Profile
@denguir
denguir / cuda_install.md
Last active December 28, 2025 15:53
Installation procedure for CUDA / cuDNN / TensorRT

How to install CUDA / cuDNN / TensorRT on Ubuntu

Install NVIDIA drivers

Update & upgrade

sudo apt update && sudo apt upgrade

Remove previous NVIDIA installation

@YashasSamaga
YashasSamaga / D0_NOTICE.md
Last active January 19, 2022 16:51
[UNOFFICIAL] Summary of the CUDA backend in OpenCV DNN

DISCLAIMER

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.

@uelordi01
uelordi01 / tensorflow_inference android
Last active May 10, 2018 08:30
build tensorflow inference
bazel build -c opt //tensorflow/contrib/android:libtensorflow_inference.so \
--crosstool_top=//external:android/crosstool \
--host_crosstool_top=@bazel_tools//tools/cpp:toolchain --cpu=armeabi-v7a
@uelordi01
uelordi01 / slim_apk_compilation.sh
Last active May 24, 2018 10:23
It makes the selective registration on the tensorflow inference native library which means that in that library will be only the model operations
#!/bin/bash
TENSORFLOW_DIR=/home/VICOMTECH/uelordi/repos/tensorflow
MODEL_NAME=quantized_face_graph.pb
arch=armeabi-v7a
ANDROID_PROJ=/home/VICOMTECH/uelordi/projects/SwitchTrackingEngine/kanvas_tracker/kt/tools/Deep-learning-tools/android/TFFaceDetection
NATIVE_LIB_DIR=${ANDROID_PROJ}/app/src/main/jniLibs/$arch
JAVA_LIBRARY_DIR=${ANDROID_PROJ}/app/libs
#APPLY SELECTIVE REGISTRATION:
OLD_PWD=$(pwd)
@uelordi01
uelordi01 / frozen_model_to_tflite.sh
Last active May 24, 2018 10:31
command to convert a quantized frozen model to tflite or .lite model. The custom operation flag not sure whether is necesary.
toco \
--input_file=frozen_output.pb \
--output_file=optimized_graph_seg.lite \
--input_format=TENSORFLOW_GRAPHDEF \
--output_format=TFLITE \
--input_shape=1024,2048,3 \
--input_array=Placeholder \
--output_array=Reshape_1 \
--inference_type=FLOAT \
--input_type=FLOAT
@daj
daj / ops_to_register.h
Created October 7, 2017 22:59
Example ops_to_register.h file for the TensorFlow model in the AndroidTensorFlowMNISTExample (https://github.com/daj/AndroidTensorFlowMNISTExample/commit/6e1b15ff6d3182be0e665c0456f356ffc2f62514)
// This file was autogenerated by print_selective_registration_header.py
#ifndef OPS_TO_REGISTER
#define OPS_TO_REGISTER
namespace {
constexpr const char* skip(const char* x) {
return (*x) ? (*x == ' ' ? skip(x + 1) : x) : x;
}
constexpr bool isequal(const char* x, const char* y) {

Install dlib and face_recognition on a Raspberry Pi

Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.

Steps

Download the latest Raspbian Jessie Light image. Earlier versions of Raspbian won't work.

Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.

@frfahim
frfahim / install virtualenv ubuntu 16.04.md
Last active July 17, 2025 07:53
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@curioustechizen
curioustechizen / UseApiKey.java
Created April 6, 2015 07:37
Android: Loading API Keys and other secrets from properties file using gradle
String apiKey = BuildConfig.API_KEY
// callback4.cpp - C++11 Lambda Callback
// To build:
// g++ -std=c++11 callback4.cpp
// Situation: A "Caller" class allows another class "Callee"
// to connect to it via callback. How to implement this?
// A C++11 lambda function can be used.