-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBinary_Image_Classification_Image_Scrambler.py
More file actions
55 lines (53 loc) · 1.44 KB
/
Binary_Image_Classification_Image_Scrambler.py
File metadata and controls
55 lines (53 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#IF YOU ARE LOOKING FOR A REAL FILE, YOU IN THE WRONG PLACE BROTHER
import numpy as np
import cv2
from random import randint as rand
filename = ""
Validation_Size = 1
Max_size = 10 #So random(1,max_size) if less than or equal to validation size, then its part of validation set...
input_pose = "Input\Pose\pose_img"#Damn
input_std = "Input\Std\std_img"
output_pose = "Pose\pose_img"
output_std = "Std\std_img"
Validationset = "Output\Validate\\"
Testset = "Output\Test\\"
#First the std files
end = False
i = 0
k = 473
while(not end):
i = i + 1
k = k + 1
#try:
filename = input_std + str(i) + ".jpg"
image = cv2.imread(filename, cv2.IMREAD_COLOR)
if (image is None):
print("Std i =", i)
end = True
output = ""
if (rand(1,Max_size) <= Validation_Size):
output = Validationset
else:
output = Testset
output = output + output_std + str(k) + ".jpg"
cv2.imwrite(output, image)
end = True
i = 0
k = 300
while(not end):
i = i + 1
k = k + 1
#try:
filename = input_pose + str(i) + ".jpg"
image = cv2.imread(filename, cv2.IMREAD_COLOR)
if (image is None):
print("Pose i =", i)
end = True
output = ""
if (rand(1,Max_size) <= Validation_Size):
output = Validationset
else:
output = Testset
output = output + output_pose + str(k) + ".jpg"
cv2.imwrite(output, image)
print("Donski!")