Skip to content

Instantly share code, notes, and snippets.

@projetsdiy
projetsdiy / micropython i2c scanner
Last active May 3, 2024 19:45
Micropython i2c scanner
# Scanner i2c en MicroPython | MicroPython i2c scanner
# Renvoi l'adresse en decimal et hexa de chaque device connecte sur le bus i2c
# Return decimal and hexa adress of each i2c device
# https://projetsdiy.fr - https://diyprojects.io (dec. 2017)
import machine
i2c = machine.I2C(scl=machine.Pin(5), sda=machine.Pin(4))
print('Scan i2c bus...')
devices = i2c.scan()
@Jsevillamol
Jsevillamol / ROI_pooling.py
Last active July 3, 2024 10:06
ROI Pooling Layer
import tensorflow as tf
from tensorflow.keras.layers import Layer
class ROIPoolingLayer(Layer):
""" Implements Region Of Interest Max Pooling
for channel-first images and relative bounding box coordinates
# Constructor parameters
pooled_height, pooled_width (int) --
specify height and width of layer outputs