1
0

Merge pull request #1 from erickahmed/custom-path

Upstream on main branch
This commit is contained in:
Erick
2022-06-30 18:48:14 +02:00
committed by GitHub
8 changed files with 28 additions and 0 deletions
+6
View File
@@ -30,3 +30,9 @@
*.exe
*.out
*.app
# Folders
.history
.idea
.run
.vscode
Binary file not shown.

After

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

+22
View File
@@ -0,0 +1,22 @@
import numpy as np
import cv2
import os
from matplotlib import pyplot as plt
inputFolder = os.path.join(os.getcwd(), 'dataset', 'dataset-original')
outputFolder = os.path.join(os.getcwd(), 'dataset', 'dataset-resized')
resolution = tuple((640,640))
if os.path.exists(outputFolder) is False:
os.mkdir(outputFolder)
for filename in os.listdir(inputFolder):
if filename.endswith(".jpg") or filename.endswith(".jpeg"):
img_org = cv2.imread(inputFolder + '/' + filename)
img_res = cv2.resize(img_org, resolution)
cv2.imwrite(os.path.join(outputFolder, filename), img_res)
else:
continue
#debug string
print(cv2.__version__)