-
Notifications
You must be signed in to change notification settings - Fork 0
/
count_lifull_parsed.py
58 lines (44 loc) · 1.5 KB
/
count_lifull_parsed.py
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
56
57
58
import sys
from scipy.ndimage import binary_hit_or_miss
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
from natsort import natsorted
from glob import glob
import json
from node import SplittingTree
from utils import make_rgb_indices, rplan_map, make_door_indices, make_rgb_indices_rounding
import networkx as nx
import os
pjoin = os.path.join
import pickle
if __name__ == '__main__':
from tqdm import trange
errors = {}
for jj in tqdm(range(1)):
IMG_PATH = f'/mnt/iscratch/datasets/lifull_ddg_var/'
IMG_PATH = f'/ibex/scratch/parawr/datasets/lifull_ddg_var/'
IMG_FILE = pjoin(IMG_PATH, 'all.txt')
with open(IMG_FILE, 'r') as fd:
IMAGES = fd.readlines()
# IMAGES = natsorted(glob(IMG_PATH + '*_nodoor.png'))
bads = []
graphs_consistent = []
all_files = []
tbar = trange(len(IMAGES), desc='nothing', leave=False)
longest = 0
print(len(IMAGES))
print(len(IMAGES))
for idx in tbar:
tbar.set_description(f'length : {longest}')
# tbar.refresh()
base_file_name = pjoin(IMG_PATH, IMAGES[idx].rstrip('/\n') )
fname = base_file_name + 'negwalllist_all.pkl'
if os.path.exists(fname):
# yes += 1
with open(fname, 'rb') as fd:
walls = pickle.load(fd)
longest = max(longest, len(walls))
# print(yes)
# print(yes)