Skip to content

Instantly share code, notes, and snippets.

@natxopedreira
natxopedreira / annotation.xml
Created June 1, 2020 23:38 — forked from Prasad9/annotation.xml
A sample XML annotation file based on Pascal VOC format.
<annotation>
<folder>GeneratedData_Train</folder>
<filename>000001.png</filename>
<path>/my/path/GeneratedData_Train/000001.png</path>
<source>
<database>Unknown</database>
</source>
<size>
<width>224</width>
<height>224</height>
@natxopedreira
natxopedreira / libfacedetection
Created May 21, 2020 09:58
libfacedetection output landmarks
net = cv.dnn.readNet('facedetectcnn_320.xml', 'facedetectcnn_320.bin')
net.setPreferableBackend(cv.dnn.DNN_BACKEND_DEFAULT)
net.setPreferableTarget(cv.dnn.DNN_TARGET_MYRIAD)
outNames = net.getUnconnectedOutLayersNames()
print("outNames ", outNames)
image = cv.imread('27.jpg')
blob = cv.dnn.blobFromImage(image, size=(image.shape[1], image.shape[0]), ddepth=cv.CV_8U)
@natxopedreira
natxopedreira / openvino build
Created May 20, 2020 22:10
my notes on how to build from source
FROM debian:buster
USER root
RUN dpkg --add-architecture armhf && \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
crossbuild-essential-armhf \
cmake \
@natxopedreira
natxopedreira / openvino install from source
Last active May 27, 2020 15:29
add paths of a fresh compiled openvino from source
export PYTHONPATH="/home/pi/openvino/bin/armv7l/Release/lib/python_api/python3.7/:$PYTHONPATH"
#export PYTHONPATH="/home/pi/openvino/inference-engine/temp/opencv_4.3.0_debian9arm/python/python3:$PYTHONPATH"
export LD_LIBRARY_PATH="/home/pi/openvino/inference-engine/temp/opencv_4.3.0_debian9arm/opencv/lib/:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="/home/pi/openvino/bin/armv7l/Release/lib/:$LD_LIBRARY_PATH"
export PYTHONPATH=/home/pi/opencv_install/lib/python2.7/dist-packages/:$PYTHONPATH
export PYTHONPATH=/home/pi/opencv_install/lib/python3.7/dist-packages/:$PYTHONPATH
export LD_LIBRARY_PATH=/home/pi/opencv_install/lib/:$LD_LIBRARY_PATH
from facelib import facerec
import cv2
import time
face_detector = facerec.SSDFaceDetector(tpu=True)
landmark_detector = facerec.LandmarkDetector(name='mobilenet_int8_tpu')
feature_extractor = facerec.FeatureExtractor(name='mobilenet_int8_tpu')
pipeline = facerec.Pipeline(face_detector, landmark_detector, feature_extractor)
python style.py --style styles\Staryy.jpg --checkpoint-dir models\starry --content-weight 1.5e1 --checkpoint-iterations 1000 --batch-size 3
https://github.com/williamFalcon/tensorflow-gpu-install-ubuntu-16.04
http://blog.nitishmutha.com/tensorflow/2017/01/22/TensorFlow-with-gpu-for-windows.html
https://medium.com/@taylordenouden/installing-tensorflow-gpu-on-ubuntu-18-04-89a142325138
//
// s3Threaded.h
// AWS
//
// Created by Natxo Pedreira gonzalez on 31/5/18.
//
//
#ifndef AWS_s3Threaded_h
#define AWS_s3Threaded_h
@natxopedreira
natxopedreira / piWatchdog.h
Last active September 27, 2017 19:33
clase para rpi watchdog
#ifndef rpiWatchdog_h
#define rpiWatchdog_h
#include <linux/watchdog.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
class piWatchdog
{
From this: https://github.com/raspberrypi/linux/issues/1285#issuecomment-182264729
That is, add:
dtparam=watchdog=on
to the end of /boot/config.txt
$ ls -l /dev/wat*
crw------- 1 root root 10, 130 May 20 01:28 /dev/watchdog
crw------- 1 root root 253, 0 May 20 01:28 /dev/watchdog0