def init(): bot_id = '1437569240:AAEd2sZ0faC1EwPvQGJPPW4xf7ohP1hTzV8' updater = Updater(bot_id) updater.setPhotoHandler(imageHandler) QualityChecker.init() ShoeDetector.init() FeatureExtractor.init() data_structure = Indexer.build_data_structure(config.DATASET_PATH) Matcher.init(data_structure) print("Bot is running...") updater.start()
detector_model_path = 'models/model_frcnn.hdf5' model_rpn.load_weights(detector_model_path, by_name=True) model_classifier.load_weights(detector_model_path, by_name=True) # COMPILE MODEL model_rpn.compile(optimizer='sgd', loss='mse') model_classifier.compile(optimizer='sgd', loss='mse') # LOAD PREDICTION MODEL classifier_model_path = 'models/MobileNetV2_192_NoCar.h5' classifier = load_model(classifier_model_path) # SETUP BOT AND FOLDERS alphabeth = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'Z' ] if not os.path.exists("res"): os.makedirs("res") classif_input = 192 marker_true = cv2.imread("V_tick.png", -1) marker_false = cv2.imread("X_tick.png", -1) bot_id = '*********' updater = Updater(bot_id) updater.setPhotoHandler(imageHandler) print('---------- BOT IS READY') updater.start()