Skip to content

Instantly share code, notes, and snippets.

View ThibautLucas's full-sized avatar

Thibaut Lucas ThibautLucas

View GitHub Profile
@ThibautLucas
ThibautLucas / train.py
Last active January 16, 2023 16:06
train yolov8
from utils import (
picsell, yolo
)
import os
from picsellia.types.enums import AnnotationFileType
from ultralytics import YOLO
if __name__ == "__main__":
imdir = "data"
def preprocess(path):
img = cv2.imread(path)
input_tensor = tf.convert_to_tensor(image_np)
return input_tensor
def blur(img, bbox):
imagette = img[bbox[0]:bbox[2], bbox[1]:bbox[3]]
w, h = imagette.shape[:2]
face_detector = tf.saved_model.load('saved_model')
def preprocess(path):
img = cv2.imread(path)
input_tensor = tf.convert_to_tensor(image_np)
input_tensor = input_tensor[tf.newaxis, ...]
return input_tensor
import os
import numpy as np
import cv2
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
tf.get_logger().setLevel('ERROR')
gpus = tf.config.experimental.list_physical_devices('GPU')
for gpu in gpus:
print(gpu)
tf.config.experimental.set_memory_growth(gpu, True)

Keybase proof

I hereby claim:

  • I am thibautlucas on github.
  • I am tib_picsell (https://keybase.io/tib_picsell) on keybase.
  • I have a public key ASClrWAKcUIfu9H4N0a4F1uOGR0SinNjbSECKeeWZyROhwo

To claim this, I am signing this object: