import numpy as np import pathlib from decimal import Decimal, ROUND_HALF_UP from keras.utils import to_categorical from sklearn.preprocessing import LabelEncoder from PIL import Image from keras.applications.mobilenet import MobileNet class BalancedImageDataGenerator(object): def __init__(self): self.reset() def reset(self): self.images = [] self.labels = [] def round(self, f): return Decimal(str