File size: 413 Bytes
fb12fe1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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