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:
To check which ones are writable, use this helper:
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
Treat this output as ground truth for your build. Use it to verify assumptions before wiring up UI elements or CLI options based on these properties.
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
You’ll also see helpful read-only properties like label_dictionary, and model_info.
Last updated
Was this helpful?

