Skip to content

Instantly share code, notes, and snippets.

View aliaminibagh's full-sized avatar
🙃

ALi Amini Bagh aliaminibagh

🙃
View GitHub Profile
@aliaminibagh
aliaminibagh / draw_rectangles_from_yolo.py
Last active March 6, 2024 08:53
A function for draw rectangle using yolo text file on input image and save the result
import cv2
def draw_rectangles_from_yolo(image_path, text_file_path, output_image_name):
image = cv2.imread(image_path)
with open(text_file_path, 'r') as file:
lines = file.readlines()
for line in lines:
data = line.split()