https://github.com/brownvc/deep-synth
Revision b800e11290b763b58e7d3b30329769a7b77cd12a authored by kwang-ether on 14 June 2019, 23:53:57 UTC, committed by kwang-ether on 14 June 2019, 23:53:57 UTC
1 parent 79eaa7f
Tip revision: b800e11290b763b58e7d3b30329769a7b77cd12a authored by kwang-ether on 14 June 2019, 23:53:57 UTC
remove csv
remove csv
Tip revision: b800e11
create_data.py
"""
Creates all the necessary dataset from raw SUNCG
Make sure to read README
IMPORTANT: make sure you don't have a directory named `temp`
under SCENESYNTH_ROOT_PATH, since that will be removed relentlessly
"""
#Didn't implement any checkpoints, comment out parts as you wish...
import shutil
from utils import get_data_root_dir
from data.object import parse_objects
root_dir = get_data_root_dir()
parse_objects()
from data.dataset import create_dataset
print("Creating initial dataset...")
create_dataset()
from scene_filter import get_filter, run_filter
from model_prior import ModelPrior
print("Extracting houses with acceptable quality...")
filter_description = [("good_house",)]
run_filter(filter_description, "main", "good", 1, 1, 0, 1, 0)
print()
print("Creating bedroom dataset...")
filter_description = [("room_type", ["Bedroom"]), ("floor_node",), ("renderable",)]
run_filter(filter_description, "good", "temp", 1, 1, 0, 1, 0)
filter_description = [("bedroom", "final"), ("collision",)]
run_filter(filter_description, "temp", "bedroom", 1, 1, 1, 0, 1)
print()
print("Creating model prior for bedroom...")
mp = ModelPrior()
mp.learn("bedroom")
mp.save()
print()
shutil.rmtree(f"{root_dir}/temp")
print("Creating living room dataset...")
filter_description = [("room_type", ["Living_Room"]), ("floor_node",), ("renderable",)]
run_filter(filter_description, "good", "temp", 1, 1, 0, 1, 0)
filter_description = [("livingroom", "final"), ("collision",)]
run_filter(filter_description, "temp", "living", 1, 1, 1, 0, 1)
print()
print("Creating model prior for living room...")
mp = ModelPrior()
mp.learn("living")
mp.save()
print()
shutil.rmtree(f"{root_dir}/temp")
print("Creating office dataset...")
filter_description = [("room_type", ["Office"]), ("floor_node",), ("renderable",)]
run_filter(filter_description, "good", "temp", 1, 1, 0, 1, 0)
filter_description = [("office", "final"), ("collision",)]
run_filter(filter_description, "temp", "office", 1, 1, 1, 0, 1)
print()
print("Creating model prior for office...")
mp = ModelPrior()
mp.learn("office")
mp.save()
print()
shutil.rmtree(f"{root_dir}/temp")

Computing file changes ...