mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #2263 from kwagyeman/kwabena/fix_ml_scaling
modules/py_image: Change scale argument to (min,max) range.
This commit is contained in:
commit
e9a6cbac34
@ -50,7 +50,7 @@ def fomo_post_process(model, inputs, outputs):
|
||||
n, oh, ow, oc = model.output_shape[0]
|
||||
nms = NMS(ow, oh, inputs[0].roi)
|
||||
for i in range(oc):
|
||||
img = image.Image(outputs[0], shape=(oh, ow, 1), strides=(i, oc), scale=(255, 0))
|
||||
img = image.Image(outputs[0], shape=(oh, ow, 1), strides=(i, oc), scale=(0, 1))
|
||||
blobs = img.find_blobs(
|
||||
threshold_list, x_stride=1, area_threshold=1, pixels_threshold=1
|
||||
)
|
||||
|
||||
@ -6379,8 +6379,8 @@ mp_obj_t py_image_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw
|
||||
|
||||
mp_obj_t *scale;
|
||||
mp_obj_get_array_fixed_n(args[ARG_scale].u_obj, 2, &scale);
|
||||
float fscale = mp_obj_get_float(scale[0]);
|
||||
float fadd = mp_obj_get_float(scale[1]);
|
||||
float fscale = 255.0f / (mp_obj_get_float(scale[1]) - mp_obj_get_float(scale[0]));
|
||||
float fadd = -mp_obj_get_float(scale[0]) * fscale;
|
||||
|
||||
if (args[ARG_copy_to_fb].u_bool) {
|
||||
py_helper_set_to_framebuffer(&image);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user