mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
19 lines
627 B
Python
19 lines
627 B
Python
# This file is part of the OpenMV project.
|
|
#
|
|
# Copyright (c) 2024 Ibrahim Abdelkader <iabdalkader@openmv.io>
|
|
# Copyright (c) 2024 Kwabena W. Agyeman <kwagyeman@openmv.io>
|
|
#
|
|
# This work is licensed under the MIT license, see the file LICENSE for details.
|
|
import uml
|
|
import image
|
|
from ml.preprocessing import Normalization
|
|
|
|
|
|
class Model(uml.Model):
|
|
def __init__(self, *args, **kwargs):
|
|
super().__init__(*args, kwargs.get("load_to_fb", False))
|
|
|
|
def predict(self, args, **kwargs):
|
|
args = [Normalization()(x) if isinstance(x, image.Image) else x for x in args]
|
|
return super().predict(args, **kwargs)
|