(cls, *args, **kwargs)
| 25 | |
| 26 | # ensure predictor be initialized only once by using Singleton Pattern |
| 27 | def __new__(cls, *args, **kwargs): |
| 28 | if not hasattr(cls, '__instance'): |
| 29 | cls.__instance = super().__new__(cls) |
| 30 | cls.__model = load_model('app/models/convolutional.h5') |
| 31 | return cls.__instance |
| 32 | |
| 33 | @staticmethod |
| 34 | def predict(input_data): |