TestAPI / app /__init__.py
pawanmau01's picture
Added App Folder
fb12fe1 verified
raw
history blame
413 Bytes
from flask import Flask
from ultralytics import YOLO
def create_app():
app = Flask(__name__)
from .api import ocr_bp
app.register_blueprint(ocr_bp)
with app.app_context():
# Load model once
app.models = {
'adhaarModel': YOLO('models/aadhaarYolov8.pt'),
'panModel': YOLO('models/PanYolov8.pt') # Load additional models as needed
}
return app