mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
modules/py_ml: Fix model kwargs. (#2280)
* modules/py_ml: Fix model kwargs.
This commit is contained in:
parent
0ed19e085d
commit
357b6f9b07
@ -11,7 +11,7 @@ from ml.preprocessing import Normalization
|
|||||||
|
|
||||||
class Model(uml.Model):
|
class Model(uml.Model):
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, kwargs.get("load_to_fb", False))
|
||||||
|
|
||||||
def predict(self, args, **kwargs):
|
def predict(self, args, **kwargs):
|
||||||
args = [Normalization()(x) if isinstance(x, image.Image) else x for x in args]
|
args = [Normalization()(x) if isinstance(x, image.Image) else x for x in args]
|
||||||
|
|||||||
@ -266,7 +266,7 @@ mp_obj_t py_ml_model_make_new(const mp_obj_type_t *type, size_t n_args, size_t n
|
|||||||
enum { ARG_path, ARG_load_to_fb };
|
enum { ARG_path, ARG_load_to_fb };
|
||||||
static const mp_arg_t allowed_args[] = {
|
static const mp_arg_t allowed_args[] = {
|
||||||
{ MP_QSTR_path, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
{ MP_QSTR_path, MP_ARG_REQUIRED | MP_ARG_OBJ },
|
||||||
{ MP_QSTR_load_to_fb, MP_ARG_INT | MP_ARG_KW_ONLY, {.u_bool = false } },
|
{ MP_QSTR_load_to_fb, MP_ARG_REQUIRED | MP_ARG_BOOL },
|
||||||
};
|
};
|
||||||
|
|
||||||
// Parse args.
|
// Parse args.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user