MCPcopy Create free account
hub / github.com/RozDavid/UnScene3D / evaluate

Function evaluate

benchmark/evaluate_semantic_instance.py:459–731  ·  view source on GitHub ↗
(preds: dict, gt_path: str, output_file: str, dataset: str = "scannet", gt_dict: dict = None, print_scene_results: bool = False)

Source from the content-addressed store, hash-verified

457
458
459def evaluate(preds: dict, gt_path: str, output_file: str, dataset: str = "scannet", gt_dict: dict = None, print_scene_results: bool = False):
460 global CLASS_LABELS
461 global VALID_CLASS_IDS
462 global ID_TO_LABEL
463 global LABEL_TO_ID
464 global opt
465
466 if dataset == "stpls3d":
467 # global CLASS_LABELS
468 # global VALID_CLASS_IDS
469 # global ID_TO_LABEL
470 # global LABEL_TO_ID
471
472 opt['min_region_sizes'] = np.array([10])
473
474 CLASS_LABELS = ['Build', 'LowVeg', 'MediumVeg', 'HighVeg', 'Vehicle', 'Truck', 'Aircraft', 'MilitaryVeh',
475 'Bike', 'Motorcycle', 'LightPole', 'StreetSign', 'Clutter', 'Fence']
476 VALID_CLASS_IDS = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14])
477
478 ID_TO_LABEL = {}
479 LABEL_TO_ID = {}
480 for i in range(len(VALID_CLASS_IDS)):
481 LABEL_TO_ID[CLASS_LABELS[i]] = VALID_CLASS_IDS[i]
482 ID_TO_LABEL[VALID_CLASS_IDS[i]] = CLASS_LABELS[i]
483
484 if dataset == "s3dis":
485 # global CLASS_LABELS
486 # global VALID_CLASS_IDS
487 # global ID_TO_LABEL
488 # global LABEL_TO_ID
489
490 CLASS_LABELS = ['ceiling', 'floor', 'wall', 'beam', 'column', 'window', 'door', 'table',
491 'chair', 'sofa', 'bookcase', 'board', 'clutter']
492 VALID_CLASS_IDS = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13])
493 ID_TO_LABEL = {}
494 LABEL_TO_ID = {}
495 for i in range(len(VALID_CLASS_IDS)):
496 LABEL_TO_ID[CLASS_LABELS[i]] = VALID_CLASS_IDS[i]
497 ID_TO_LABEL[VALID_CLASS_IDS[i]] = CLASS_LABELS[i]
498
499 if dataset == "scannet200":
500 CLASS_LABELS = (
501 'chair', 'table', 'door', 'couch', 'cabinet', 'shelf', 'desk', 'office chair', 'bed', 'pillow', 'sink', 'picture', 'window', 'toilet', 'bookshelf', 'monitor', 'curtain', 'book', 'armchair', 'coffee table', 'box',
502 'refrigerator', 'lamp', 'kitchen cabinet', 'towel', 'clothes', 'tv', 'nightstand', 'counter', 'dresser', 'stool', 'cushion', 'plant', 'ceiling', 'bathtub', 'end table', 'dining table', 'keyboard', 'bag', 'backpack',
503 'toilet paper',
504 'printer', 'tv stand', 'whiteboard', 'blanket', 'shower curtain', 'trash can', 'closet', 'stairs', 'microwave', 'stove', 'shoe', 'computer tower', 'bottle', 'bin', 'ottoman', 'bench', 'board', 'washing machine', 'mirror',
505 'copier',
506 'basket', 'sofa chair', 'file cabinet', 'fan', 'laptop', 'shower', 'paper', 'person', 'paper towel dispenser', 'oven', 'blinds', 'rack', 'plate', 'blackboard', 'piano', 'suitcase', 'rail', 'radiator', 'recycling bin',
507 'container',
508 'wardrobe', 'soap dispenser', 'telephone', 'bucket', 'clock', 'stand', 'light', 'laundry basket', 'pipe', 'clothes dryer', 'guitar', 'toilet paper holder', 'seat', 'speaker', 'column', 'bicycle', 'ladder', 'bathroom stall',
509 'shower wall',
510 'cup', 'jacket', 'storage bin', 'coffee maker', 'dishwasher', 'paper towel roll', 'machine', 'mat', 'windowsill', 'bar', 'toaster', 'bulletin board', 'ironing board', 'fireplace', 'soap dish', 'kitchen counter', 'doorframe',
511 'toilet paper dispenser', 'mini fridge', 'fire extinguisher', 'ball', 'hat', 'shower curtain rod', 'water cooler', 'paper cutter', 'tray', 'shower door', 'pillar', 'ledge', 'toaster oven', 'mouse', 'toilet seat cover dispenser',
512 'furniture', 'cart', 'storage container', 'scale', 'tissue box', 'light switch', 'crate', 'power outlet', 'decoration', 'sign', 'projector', 'closet door', 'vacuum cleaner', 'candle', 'plunger', 'stuffed animal', 'headphones',
513 'dish rack',
514 'broom', 'guitar case', 'range hood', 'dustpan', 'hair dryer', 'water bottle', 'handicap bar', 'purse', 'vent', 'shower floor', 'water pitcher', 'mailbox', 'bowl', 'paper bag', 'alarm clock', 'music stand', 'projector screen',
515 'divider',
516 'laundry detergent', 'bathroom counter', 'object', 'bathroom vanity', 'closet wall', 'laundry hamper', 'bathroom stall door', 'ceiling light', 'trash bin', 'dumbbell', 'stair rail', 'tube', 'bathroom cabinet', 'cd case',

Callers 1

Calls 8

evaluate_matchesFunction · 0.85
compute_metric_averagesFunction · 0.85
print_metric_resultsFunction · 0.85
save_scene_resultsFunction · 0.85
joinMethod · 0.80
write_result_fileFunction · 0.70

Tested by

no test coverage detected