Skip to content

Instantly share code, notes, and snippets.

View ricardodeazambuja's full-sized avatar

Ricardo de Azambuja ricardodeazambuja

View GitHub Profile
@ricardodeazambuja
ricardodeazambuja / docker-cleanup-resources.md
Created June 30, 2019 12:51 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@ricardodeazambuja
ricardodeazambuja / take_photo_colab.py
Last active October 7, 2020 19:04
Saving images from webcam on Google Colab
# I have no idea who is the author of the code
# in this cell that saves an image from a webcam
# inside google colab.
# It comes from a notebook called "📸 Take a photo with your webcam"
from IPython.display import HTML, Audio
from google.colab.output import eval_js
from base64 import b64decode
import numpy as np
import io
@ricardodeazambuja
ricardodeazambuja / Dockerfile
Last active June 29, 2019 23:58
Docker image for RPI ZERO with OpenCV4 and friends... more compact, but annoying to build.
FROM balenalib/rpi-raspbian:stretch
# This is responsible for making your current docker work with arm images:
# $ sudo apt install qemu qemu-user-static binfmt-support-
# And this line is responsible for enabling it (MUST run after a restart):
# $ docker run --privileged linuxkit/binfmt:v0.7
ENV OPENCV_VERSION=4.1.0
@ricardodeazambuja
ricardodeazambuja / test_pizero_opencv.py
Created June 21, 2019 14:18
Testing the OpenCV Optical Flow tutorial on the Raspberry Pi Zero
import io
import time
import picamera
#from PIL import Image
import cv2 as cv
import numpy as np
NoI = 200
@ricardodeazambuja
ricardodeazambuja / Dockerfile
Last active June 20, 2019 16:04
Docker image for RPI ZERO with OpenCV4 and friends...
FROM balenalib/rpi-raspbian:stretch
# This is responsible for making your current docker work with arm images:
# $ sudo apt install qemu qemu-user-static binfmt-support-
# And this line is responsible for enabling it (MUST run after a restart):
# $ docker run --privileged linuxkit/binfmt:v0.7
RUN apt-get update
RUN apt-get upgrade -y
@ricardodeazambuja
ricardodeazambuja / Dockerfile
Last active June 19, 2019 22:11
Alpine for RPI Zero with Python3 / Numpy / Scipy / OpenCV 4... (WORK IN PROGRESS!!!)
FROM arm32v6/alpine
RUN apk add --update --no-cache \
build-base \
unzip \
wget \
cmake \
# A C language family front-end for LLVM (development files)
clang-dev \
linux-headers
@ricardodeazambuja
ricardodeazambuja / tf-rasp.md
Created May 26, 2019 11:56 — forked from EKami/tf-rasp.md
Building TensorFlow for Raspberry Pi: a Step-By-Step Guide

Building TensorFlow 1.3.0-rc1 for Raspberry Pi/Ubuntu 16.04: a Step-By-Step Guide

Here you'll learn how to build Tensorflow for the raspberry pi 3 with either the Python API or as a standalone shared library which can be interfaced from the C++ API and eventually as a library which can be used in other languages.

For the C++ library this tutorial will show you how extract tensorflow library and headers to use in any environment you want.

(This tutorial couldn't be possible without the help of the people from the References section)

What You Need

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
print('This piece of code came straight from a GitHub Gist!')
@ricardodeazambuja
ricardodeazambuja / Dockerfile
Last active April 3, 2019 20:21
Dockerfile for Tensorflow 2.0 (GPU) and opengl enabled (nvidia-docker2)
#
# Dockerfile for Tensorflow 2.0 (GPU) and opengl enabled (nvidia-docker2)
#
FROM nvcr.io/nvidia/cudagl:10.0-runtime-ubuntu18.04 as base
# Tensorflow 2 has problems with CUDA 10.1
ARG DEBIAN_FRONTEND=noninteractive