Exemplo n.º 1
0
from builtins import input
import numpy as np

import ensure_segmappy_is_installed
from segmappy import Config
from segmappy.tools.classifiertools import (
    get_default_dataset,
    get_default_preprocessor,
    visualize,
)

configfile = "default_training.ini"
config = Config(configfile)

# load dataset
dataset = get_default_dataset(config)
preprocessor = get_default_preprocessor(config)

segments, positions, classes, n_classes, _, _, _ = dataset.load(
    preprocessor=preprocessor)
duplicate_classes = dataset.duplicate_classes
duplicate_ids = dataset.duplicate_ids

# different visualization commands
VOXELIZED = True
CMD_VOXELIZED = ["v", "voxelize"]
CMD_CLASS = ["c", "class"]
CMD_LAST = ["l", "last"]
CMD_CLASS_INFO = ["i", "info"]
CMD_DUPLICATE_INFO = ["d", "duplicate"]
CMD_QUIT = ["q", "quit"]
Exemplo n.º 2
0
config = Config(configfile)

# tweak config parameters
config.folder = "DCC03"
config.use_matches = False

# False: will go through unlabeled segments and append to the csv file
# True: will go through the segments labeled as CLASS and
#       rewrite the database at the end
RELABEL = False
AUTOWALLS = False
CLASS = 1
CLASSES = ["other", "car", "building"]

# load dataset
dataset = get_default_dataset(config, config.folder)

segments, _, ids, n_ids, features, matches, _, int_paths, mask_paths, range_paths, _ = dataset.load(
)

lids = dataset.lids
lids_lookup = dict()
for i, lid in enumerate(lids):
    lids_lookup[lid] = i
labels = dataset.labels

if RELABEL:
    default_label = CLASS
    n_objects = np.sum(labels == CLASS)
    print("There are " + str(n_objects) + " " + CLASSES[CLASS] + "(s).")
else: