Merge pull request #1 from erickahmed/custom-path
Upstream on main branch
This commit is contained in:
@@ -30,3 +30,9 @@
|
|||||||
*.exe
|
*.exe
|
||||||
*.out
|
*.out
|
||||||
*.app
|
*.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 |
@@ -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__)
|
||||||
Reference in New Issue
Block a user