Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- blank.jpg +0 -0
- ct/create_lists.py +32 -0
- ct/create_masks.py +26 -0
- ct/final.zip +3 -0
- ct/imgs/ID00007637202177411956430_0.jpg +0 -0
- ct/imgs/ID00007637202177411956430_11.jpg +0 -0
- ct/imgs/ID00007637202177411956430_14.jpg +0 -0
- ct/imgs/ID00007637202177411956430_17.jpg +0 -0
- ct/imgs/ID00007637202177411956430_2.jpg +0 -0
- ct/imgs/ID00007637202177411956430_22.jpg +0 -0
- ct/imgs/ID00007637202177411956430_25.jpg +0 -0
- ct/imgs/ID00007637202177411956430_3.jpg +0 -0
- ct/imgs/ID00007637202177411956430_6.jpg +0 -0
- ct/imgs/ID00007637202177411956430_9.jpg +0 -0
- ct/imgs/ID00009637202177434476278_102.jpg +0 -0
- ct/imgs/ID00009637202177434476278_105.jpg +0 -0
- ct/imgs/ID00009637202177434476278_108.jpg +0 -0
- ct/imgs/ID00009637202177434476278_111.jpg +0 -0
- ct/imgs/ID00009637202177434476278_114.jpg +0 -0
- ct/imgs/ID00009637202177434476278_117.jpg +0 -0
- ct/imgs/ID00009637202177434476278_120.jpg +0 -0
- ct/imgs/ID00009637202177434476278_123.jpg +0 -0
- ct/imgs/ID00009637202177434476278_126.jpg +0 -0
- ct/imgs/ID00009637202177434476278_129.jpg +0 -0
- ct/imgs/ID00009637202177434476278_132.jpg +0 -0
- ct/imgs/ID00009637202177434476278_135.jpg +0 -0
- ct/imgs/ID00009637202177434476278_138.jpg +0 -0
- ct/imgs/ID00009637202177434476278_141.jpg +0 -0
- ct/imgs/ID00009637202177434476278_144.jpg +0 -0
- ct/imgs/ID00009637202177434476278_147.jpg +0 -0
- ct/imgs/ID00009637202177434476278_150.jpg +0 -0
- ct/imgs/ID00009637202177434476278_153.jpg +0 -0
- ct/imgs/ID00009637202177434476278_156.jpg +0 -0
- ct/imgs/ID00009637202177434476278_159.jpg +0 -0
- ct/imgs/ID00009637202177434476278_162.jpg +0 -0
- ct/imgs/ID00009637202177434476278_165.jpg +0 -0
- ct/imgs/ID00009637202177434476278_168.jpg +0 -0
- ct/imgs/ID00009637202177434476278_171.jpg +0 -0
- ct/imgs/ID00009637202177434476278_174.jpg +0 -0
- ct/imgs/ID00009637202177434476278_177.jpg +0 -0
- ct/imgs/ID00009637202177434476278_18.jpg +0 -0
- ct/imgs/ID00009637202177434476278_182.jpg +0 -0
- ct/imgs/ID00009637202177434476278_185.jpg +0 -0
- ct/imgs/ID00009637202177434476278_188.jpg +0 -0
- ct/imgs/ID00009637202177434476278_190.jpg +0 -0
- ct/imgs/ID00009637202177434476278_193.jpg +0 -0
- ct/imgs/ID00009637202177434476278_196.jpg +0 -0
- ct/imgs/ID00009637202177434476278_199.jpg +0 -0
- ct/imgs/ID00009637202177434476278_201.jpg +0 -0
- ct/imgs/ID00009637202177434476278_204.jpg +0 -0
blank.jpg
ADDED
ct/create_lists.py
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import random
|
2 |
+
import os
|
3 |
+
|
4 |
+
exs = []
|
5 |
+
for f in os.listdir("imgs"):
|
6 |
+
ex = f.split(".jpg")[0]
|
7 |
+
exs.append(ex)
|
8 |
+
|
9 |
+
random.shuffle(exs)
|
10 |
+
|
11 |
+
fp = open("train.csv")
|
12 |
+
|
13 |
+
train_exs = []
|
14 |
+
|
15 |
+
for line in fp:
|
16 |
+
train_exs.append(line.strip().split(",")[0])
|
17 |
+
fp.close()
|
18 |
+
|
19 |
+
test_exs = [ex for ex in exs if ex not in train_exs]
|
20 |
+
print(len(exs), len(test_exs))
|
21 |
+
#train_exs = exs[:3896]
|
22 |
+
#test_exs = exs[int(len(exs)*0.2) + 1:]
|
23 |
+
|
24 |
+
#train_fp = open("train.csv", "w")
|
25 |
+
#for ex in train_exs:
|
26 |
+
# train_fp.write(ex + ",1\n")
|
27 |
+
#train_fp.close()
|
28 |
+
|
29 |
+
test_fp = open("test.csv", "w")
|
30 |
+
for ex in test_exs:
|
31 |
+
test_fp.write(ex + ",1\n")
|
32 |
+
test_fp.close()
|
ct/create_masks.py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from PIL import Image
|
2 |
+
import cv2
|
3 |
+
import os
|
4 |
+
import numpy as np
|
5 |
+
|
6 |
+
i = 0
|
7 |
+
threshold = 240
|
8 |
+
m = 0
|
9 |
+
for img in os.listdir("orig_masks"):
|
10 |
+
mask = cv2.imread("orig_masks/" + img)
|
11 |
+
for d in range(3):
|
12 |
+
mask[:, :, d][mask[:, :, d] < threshold] = 0
|
13 |
+
mask[:, :, d][mask[:, :, d] > 0] = 1
|
14 |
+
mask = mask[:, :, 0] | mask[:, :, 1] | mask[:, :, 2]
|
15 |
+
mask = (mask * 255).astype(np.uint8)
|
16 |
+
#nonzero = []
|
17 |
+
#for i in mask[np.nonzero(mask)]:
|
18 |
+
# nonzero.append(i)
|
19 |
+
if np.all(mask == 0):
|
20 |
+
print("The mask contains all zeros.")
|
21 |
+
continue
|
22 |
+
cv2.imwrite("masks/" + img, mask)
|
23 |
+
img_split = img.split("_")
|
24 |
+
os.system("cp orig_imgs/" + img_split[0] + "_" + img_split[2] + " imgs/")
|
25 |
+
i += 1
|
26 |
+
print("Done ", str(i), str(m))
|
ct/final.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:87b03361d7b4d154fb15ee0887c83b12e9441b81158201916bcf1fdd529e355c
|
3 |
+
size 488050930
|
ct/imgs/ID00007637202177411956430_0.jpg
ADDED
ct/imgs/ID00007637202177411956430_11.jpg
ADDED
ct/imgs/ID00007637202177411956430_14.jpg
ADDED
ct/imgs/ID00007637202177411956430_17.jpg
ADDED
ct/imgs/ID00007637202177411956430_2.jpg
ADDED
ct/imgs/ID00007637202177411956430_22.jpg
ADDED
ct/imgs/ID00007637202177411956430_25.jpg
ADDED
ct/imgs/ID00007637202177411956430_3.jpg
ADDED
ct/imgs/ID00007637202177411956430_6.jpg
ADDED
ct/imgs/ID00007637202177411956430_9.jpg
ADDED
ct/imgs/ID00009637202177434476278_102.jpg
ADDED
ct/imgs/ID00009637202177434476278_105.jpg
ADDED
ct/imgs/ID00009637202177434476278_108.jpg
ADDED
ct/imgs/ID00009637202177434476278_111.jpg
ADDED
ct/imgs/ID00009637202177434476278_114.jpg
ADDED
ct/imgs/ID00009637202177434476278_117.jpg
ADDED
ct/imgs/ID00009637202177434476278_120.jpg
ADDED
ct/imgs/ID00009637202177434476278_123.jpg
ADDED
ct/imgs/ID00009637202177434476278_126.jpg
ADDED
ct/imgs/ID00009637202177434476278_129.jpg
ADDED
ct/imgs/ID00009637202177434476278_132.jpg
ADDED
ct/imgs/ID00009637202177434476278_135.jpg
ADDED
ct/imgs/ID00009637202177434476278_138.jpg
ADDED
ct/imgs/ID00009637202177434476278_141.jpg
ADDED
ct/imgs/ID00009637202177434476278_144.jpg
ADDED
ct/imgs/ID00009637202177434476278_147.jpg
ADDED
ct/imgs/ID00009637202177434476278_150.jpg
ADDED
ct/imgs/ID00009637202177434476278_153.jpg
ADDED
ct/imgs/ID00009637202177434476278_156.jpg
ADDED
ct/imgs/ID00009637202177434476278_159.jpg
ADDED
ct/imgs/ID00009637202177434476278_162.jpg
ADDED
ct/imgs/ID00009637202177434476278_165.jpg
ADDED
ct/imgs/ID00009637202177434476278_168.jpg
ADDED
ct/imgs/ID00009637202177434476278_171.jpg
ADDED
ct/imgs/ID00009637202177434476278_174.jpg
ADDED
ct/imgs/ID00009637202177434476278_177.jpg
ADDED
ct/imgs/ID00009637202177434476278_18.jpg
ADDED
ct/imgs/ID00009637202177434476278_182.jpg
ADDED
ct/imgs/ID00009637202177434476278_185.jpg
ADDED
ct/imgs/ID00009637202177434476278_188.jpg
ADDED
ct/imgs/ID00009637202177434476278_190.jpg
ADDED
ct/imgs/ID00009637202177434476278_193.jpg
ADDED
ct/imgs/ID00009637202177434476278_196.jpg
ADDED
ct/imgs/ID00009637202177434476278_199.jpg
ADDED
ct/imgs/ID00009637202177434476278_201.jpg
ADDED
ct/imgs/ID00009637202177434476278_204.jpg
ADDED