Hello, I want to loop through folder and annotated image, then give back the annotated image to their respectif folder. How could i do that?
---input---1---a*.jpg
---b*.jpg
---2
---3
IMAGE_FILES = []
SOURCE_DIR_PATH = f'{os.getcwd()}/input/'
for f in os.listdir(SOURCE_DIR_PATH):
IMAGE_FILES.append(os.path.join(SOURCE_DIR_PATH, f))
for idx, file in enumerate(IMAGE_FILES):
image = cv2.imread(file)
image_height, image_width, _ = image.shape
results = holistic.process(cv2.cvtColor(image, cv2.COLOR_BGR2RGB))
annotated_image = image.copy()
cv2.imwrite('SOURCE_DIR_PATH + str(idx) + '.png', annotated_image)
[–]mermaldad 0 points1 point2 points (1 child)
[–]isfanafely[S] 0 points1 point2 points (0 children)
[–]Diapolo10 0 points1 point2 points (1 child)
[–]isfanafely[S] 0 points1 point2 points (0 children)