Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trying to update this #10

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions preprocess.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import numpy as np
import tensorflow as tf
from os import walk
import os
from os.path import join
from shutil import copyfile
from queue import Queue
import cv2

gpu_available = tf.test.is_gpu_available()
Expand Down Expand Up @@ -49,13 +51,16 @@ def walk_data():
"""
imgs = list()
q = Queue()
initial_itms = os.listdir("./data/")
initial_itms = os.listdir("./data/SUN2012/Images/")
print(initial_itms)
for itm in initial_itms:
q.put(os.path.abspath(itm))

while not q.empty():
itm = q.get()
# checking if item is a file anf ends in jpeg/ jpg
if os.path.isfile(itm) and itm.lower().endswith((".jpg", ".jpeg")):
if os.path.isfile(itm) and itm[len(itm)- 5:] == '.jpg':
print("added to queue")
imgs.append(itm)
# checking if item is a directory
if os.path.isdir(itm):
Expand All @@ -82,4 +87,4 @@ def convert_to_LAB():
lab = np.asarray(lab)
return lab

print(convert_to_LAB().shape)
# print(convert_to_LAB().shape)