Model properties
See what you can tune on your model—and why it matters. This page introduces the model_properties field and shows how to inspect, change, and group model settings by task.
Estimated read time: 5 minutes
This section focuses on the model_properties field in ModelSpec (and the matching writable properties on the model after loading). It shows what you can change on a DeGirum model and why—without drowning you in code.
First, quickly inspect your model to see which attributes are writable on your build. Then jump into focused subpages:
Device selection: pick hardware targets, batching, queues, and timeouts
Input preprocessing: control resize, crop, pad, and colorspace handling
Output postprocessing: adjust confidence thresholds, NMS, class filters, and caps
Image overlay: tune how detections render in demos or reviews
Two ways to specify model properties
During load (stable defaults): pass durable choices via
ModelSpec(model_properties={...}). Great for reproducible runs and team consistency.After load (live tuning): set
model.<property>at runtime to explore and iterate.
Use ModelSpec for hardware and standard preprocessing choices.
Use the live model for tuning outputs, overlays, and experiments.
Inspect your model
After loading a model, run:
# What attributes & methods exist?
dir(model)You'll see output like this:
[
"__call__",
"custom_postprocessor",
"device_type",
"devices_available",
"devices_selected",
"eager_batch_size",
"extra_device_params",
"frame_queue_depth",
"image_backend",
"inference_results_type",
"inference_timeout_s",
"input_crop_percentage",
"input_image_format",
"input_letterbox_fill_color",
"input_numpy_colorspace",
"input_pad_method",
"input_resize_method",
"input_shape",
"label_dictionary",
"measure_time",
"model_info",
"non_blocking_batch_predict",
"output_class_set",
"output_confidence_threshold",
"output_max_classes_per_detection",
"output_max_detections",
"output_max_detections_per_class",
"output_nms_threshold",
"output_pose_threshold",
"output_postprocess_type",
"output_top_k",
"output_use_regular_nms",
"overlay_alpha",
"overlay_blur",
"overlay_color",
"overlay_font_scale",
"overlay_line_width",
"overlay_show_labels",
"overlay_show_probabilities",
"predict",
"predict_batch",
"predict_dir",
"reset_time_stats",
"save_model_image",
"supported_device_types",
"time_stats",
]To check which ones are writable, use this helper:
def list_properties_with_setters(obj):
ro, rw = [], []
cls = obj.__class__
for name in dir(cls):
attr = getattr(cls, name, None)
if isinstance(attr, property):
(ro if attr.fset is None else rw).append(name)
return ro, rw
ro, rw = list_properties_with_setters(model)
print("READ‑ONLY:", sorted(ro))
print("WRITABLE:", sorted(rw))Running this function on a loaded model will output:
READ-ONLY: properties you can inspect but can't modifyWRITABLE: properties you can update at runtime
READ‑ONLY: [
"devices_available",
"label_dictionary",
"model_info",
"supported_device_types",
]
WRITABLE: [
"custom_postprocessor",
"device_type",
"devices_selected",
"eager_batch_size",
"extra_device_params",
"frame_queue_depth",
"image_backend",
"inference_results_type",
"inference_timeout_s",
"input_crop_percentage",
"input_image_format",
"input_letterbox_fill_color",
"input_numpy_colorspace",
"input_pad_method",
"input_resize_method",
"input_shape",
"measure_time",
"non_blocking_batch_predict",
"output_class_set",
"output_confidence_threshold",
"output_max_classes_per_detection",
"output_max_detections",
"output_max_detections_per_class",
"output_nms_threshold",
"output_pose_threshold",
"output_postprocess_type",
"output_top_k",
"output_use_regular_nms",
"overlay_alpha",
"overlay_blur",
"overlay_color",
"overlay_font_scale",
"overlay_line_width",
"overlay_show_labels",
"overlay_show_probabilities",
"save_model_image",
]What’s changeable—by category
Use this section as a reference. The most common writable properties are grouped by use case. Confirm actual writability using your own read-only (ro) / read/write (rw) output.
Target runtime(s):
device_type(str | list[str]) – set hardware preferences; if a list, the first available is selectedChoose indices:
devices_selected(list[int]) – which device IDs to run onDiscoveries (inspect):
supported_device_types(ro),devices_available(ro)Latency/throughput knobs:
eager_batch_size,frame_queue_depth,inference_timeout_s,non_blocking_batch_predictRuntime-specific knobs:
extra_device_params(dict) – pass vendor settings such as{"HAILO_BATCH_SIZE": 8}; overrideseager_batch_sizeon Hailo runtimes
Resize strategy:
input_pad_method–"stretch","letterbox"(default),"crop-first","crop-last"Interpolation:
input_resize_method–"bilinear"(default)"nearest","area","bicubic","lanczos"Cropping control:
input_crop_percentage– for crop‑first/crop‑last modesPad color:
input_letterbox_fill_color– defaults to black; use(114,114,114)for neutral grayColorspace/format:
input_numpy_colorspace(RGB/BGR),input_image_formatImage library:
image_backend–"opencv"(default),"pil"Extras:
save_model_imageModel‑fixed (often ro):
input_shape
Filter thresholds:
output_confidence_threshold,output_nms_thresholdCaps:
output_max_detections,output_max_detections_per_class,output_max_classes_per_detection,output_top_kFocus filters:
output_class_setAdvanced controls:
output_use_regular_nms,output_postprocess_type,output_pose_threshold,inference_results_type,custom_postprocessor
Image overlay (rendering-only)
Toggles:
overlay_show_labels,overlay_show_probabilitiesStyling:
overlay_line_width,overlay_font_scale,overlay_alpha,overlay_color,overlay_blur
Time statistics
Enable/disable:
measure_timeRead stats:
time_stats(ro)Reset:
reset_time_stats
Predict APIs (reference-only)
Sync:
predict,__call__Batch:
predict_batchFolders:
predict_dir
Last updated
Was this helpful?

