Navigation Menu

Skip to content

Commit

Permalink
test_interactive deletes input folders when on start. Fix for door te…
Browse files Browse the repository at this point in the history
…xture network.
  • Loading branch information
twak committed Jul 27, 2018
1 parent c40a841 commit e54bcb6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scripts/test_super.sh
@@ -1,4 +1,4 @@
CLASS='super10'
CLASS='zoomies2'
MODEL='bicycle_gan'


Expand Down Expand Up @@ -34,7 +34,7 @@ NUM_SAMPLES=10 # number of samples per input images
# command
CUDA_VISIBLE_DEVICES=${GPU_ID} python ./test.py \
--sync \
--dataroot /media/twak/8bc5e750-9a70-4180-8eee-ced2fbba6484/data/tile1 \
--dataroot /media/twak/8bc5e750-9a70-4180-8eee-ced2fbba6484/data/terrain1 \
--results_dir ${RESULTS_DIR} \
--G_path ${G_PATH} \
--E_path ${E_PATH} \
Expand Down
18 changes: 14 additions & 4 deletions test_interactive.py
Expand Up @@ -322,18 +322,28 @@ def go(self, directory, name, size, fit_boxes, fit_circles):
observer = Observer()

input_folder = './input/%s/' % directory

shutil.rmtree(input_folder, ignore_errors=True)

os.makedirs(input_folder + "val", exist_ok=True)

observer.schedule(
RunG(model=self.model, opt=self.optG, fit_boxes=fit_boxes, fit_circles=fit_circles, directory=directory),
path=input_folder+"val/")

input_folder_e = './input/%s_e/' % directory

shutil.rmtree(input_folder_e, ignore_errors=True)

os.makedirs(input_folder_e+"val", exist_ok=True)
observer.schedule(
RunE(self.model, self.optE, directory+"_e"),
path=input_folder_e+"val/")
observer.start()

shutil.rmtree('./input/%s_empty/' % directory, ignore_errors=True)
shutil.rmtree('./input/%s_mlabels/' % directory, ignore_errors=True)

print('[network %s is awaiting input]' % name)

# sleep until keyboard interrupt, then stop + rejoin the observer
Expand Down Expand Up @@ -373,10 +383,10 @@ def download_if_missing(self, directory, file):
# latest set
#------------------------------------------#

# Interactive("door textures", "labels2door_4",
# dataset_mode='multi',
# empty_condition=True, metrics_condition=True, imgpos_condition=True,
# metrics_mask_color=[255, 0, 0])
Interactive("door textures", "labels2door_5",
dataset_mode='multi',
empty_condition=True, metrics_condition=True, imgpos_condition=True, normalize_metrics=True,
metrics_mask_color=[255, 0, 0])

Interactive("roof greebles", "r3_clabels2labels_f001_400",
size=512, which_model_netE='resnet_512',
Expand Down

0 comments on commit e54bcb6

Please sign in to comment.