zamba.images.manager¶
get_default_transforms(model_family, image_size=None)
¶
Build the (top, bottom) eval transform lists for a preprocessing family.
The preprocessing is fully determined by model_family (and the resolved
image_size), NOT by a model_name string on the config. This lets prediction
derive transforms directly from a loaded checkpoint. Returns the transform lists
plus the resolved integer image size.
Source code in zamba/images/manager.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
resolve_inference_family(model_name, checkpoint)
¶
Determine the preprocessing family without trusting a (possibly stale/mangled)
model_name default.
When a checkpoint is provided it is authoritative: the family is read from the
checkpoint's persisted model_family / legacy zamba_model hparam, falling
back to inference from the stored architecture name. Only when there is no
checkpoint do we fall back to the configured model_name.
Source code in zamba/images/manager.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
resolve_training_image_size(config)
¶
Resolve the image size to train at.
An explicitly configured image_size always wins. Otherwise, when finetuning or
resuming from a checkpoint, the checkpoint's own image_size takes precedence over
the preprocessing-family default, since a finetuned model may have been trained at a
non-default size. Returns None (deferring to the family default) only when there is
no explicit size and no usable size on the checkpoint. The returned value may be a
scalar or a tuple; get_default_transforms normalizes it to an int.
Source code in zamba/images/manager.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | |