Mmodlist [top] Site

1. What is mmodlist ? mmodlist (short for Max-Margin Object Detection List ) is not a standalone class but a specific data format used by dlib’s fhog_object_detector and loss_mmod_ layers. It is a list of mmod_rect objects.

detector = dlib.train_simple_object_detector(images, mmodlists, options) img = dlib.load_rgb_image("test.jpg") dets = detector(img) for det in dets: print(f"Class det.label at det.rect, score det.detection_confidence") mmodlist

This guide covers the conceptual, practical, and edge-case behaviors of mmodlist in dlib's MMOD system. It is a list of mmod_rect objects

#include <dlib/image_processing.h> using namespace dlib; m = dlib

# Convert simple rectangle list to mmodlist with default label 0 def to_mmodlist(rect_list, label=0): return [dlib.mmod_rect(r, label=label, ignore=False) for r in rect_list] Reverse conversion (strip labels/ignore):

# List of images (numpy arrays or dlib array2d) images = [img1, img2, ...] boxes_per_image = [ [mmod_rect(...), mmod_rect(...)], # image 0 [mmod_rect(...)], # image 1 [] # image 2 (no objects) ] Example construction: import dlib def load_mmodlist_from_annotation(image_path, annotation_dict): img = dlib.load_rgb_image(image_path) rects = [] for obj in annotation_dict['objects']: r = dlib.rectangle( left=obj['x'], top=obj['y'], right=obj['x']+obj['w'], bottom=obj['y']+obj['h'] ) # label: 0 for 'car', 1 for 'pedestrian', etc. m = dlib.mmod_rect(r, label=obj['class_id'], ignore=obj.get('ignore', False)) rects.append(m) return rects 4. Training a MMOD Detector with mmodlist Once you have images and mmodlists , training is:

× How can I help you?