Skip to content

Instantly share code, notes, and snippets.

View lanzani's full-sized avatar
🐇
Falling down the rabbit hole

Federico Lanzani lanzani

🐇
Falling down the rabbit hole
View GitHub Profile
@lanzani
lanzani / create_release.yml
Created February 1, 2024 22:43
Create release on new tag creation.
name: Create release
on:
push:
tags:
- v*
permissions:
contents: write
@lanzani
lanzani / mediapipe_multiple_person.py
Last active April 15, 2024 03:24
Use mediapipe to find multiple person 3d keypoints
import cv2
import numpy as np
import mediapipe as mp
from mediapipe.tasks import python
from mediapipe.tasks.python import vision
from mediapipe.framework.formats import landmark_pb2
# Model available to download here: https://developers.google.com/mediapipe/solutions/vision/pose_landmarker#models
model_path = "pose_landmarker_full.task"
@lanzani
lanzani / docker compose postgres database
Created February 22, 2023 20:28
Create a test postgres database in one command.
version: "3"
services:
postgres-test:
image: postgres:15.1-alpine
ports:
- "5432:5432" # If port 5432 is already in use on the host machine, you can change this with: "5435:5432"
@lanzani
lanzani / 27-wondrous-or-unwondrous.txt
Created September 7, 2022 20:50
27 is Wondrous or Unwondrous?
27 is ODD, so I make 3n+1: 82
82 is EVEN, so I take half: 41
41 is ODD, so I make 3n+1: 124
124 is EVEN, so I take half: 62
62 is EVEN, so I take half: 31
31 is ODD, so I make 3n+1: 94
94 is EVEN, so I take half: 47
47 is ODD, so I make 3n+1: 142
142 is EVEN, so I take half: 71
71 is ODD, so I make 3n+1: 214
@lanzani
lanzani / posenet-keypoints.md
Created February 15, 2022 16:54
Jetson inference posenet key points.
Point id Point label
0 "nose"
1 "left_eye"
2 "right_eye"
3 "left_ear"
4 "right_ear"
5 "left_shoulder"
6 "right_shoulder"
7 "left_elbow"
@lanzani
lanzani / gitmoji-table.md
Created December 28, 2021 21:37
gitmoji table

Emoji list from gitmoji

Emoji Usage Tag
🎨 Improve structure / format of the code. :art:
Improve performance. :zap:
🔥 Remove code or files. :fire:
🐛 Fix a bug. :bug:
🚑️ Critical hotfix. :ambulance:
Introduce new features. :sparkles:
@lanzani
lanzani / test_gpu_compatibility.py
Last active August 4, 2022 23:16
Check CUDA compatibility with TensorFlow & DLIB.
def test_gpu_support():
"""Check CUDA compatibility with TensorFlow & DLIB.
"""
import os
import dlib
import tensorflow as tf
print("[INFO] TensorFlow: ", tf.__version__)
print("[INFO] DLIB: ", dlib.__version__)
@lanzani
lanzani / test_cameras_opencv_gs.py
Created January 6, 2021 19:27
Simple implementation for testing opencv with gstreamer for nvidia jetson.
import jetson.inference as inference
import jetson.utils as utils
import cv2
import time
# Load the net with jetson inference
net1 = inference.detectNet("ssd-mobilenet-v2", threshold=0.5)
# Define video sources