major refactor
This commit is contained in:
@@ -35,9 +35,11 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def main():
|
||||
from core.db.detect import list_scenarios
|
||||
from core.db import list_scenarios
|
||||
from core.db.connection import get_session
|
||||
|
||||
scenarios = list_scenarios()
|
||||
with get_session() as session:
|
||||
scenarios = list_scenarios(session)
|
||||
|
||||
if not scenarios:
|
||||
logger.info("No scenarios found. Create one with:")
|
||||
|
||||
@@ -121,15 +121,14 @@ def main():
|
||||
)
|
||||
|
||||
# Mark as scenario
|
||||
from core.db.detect import get_latest_checkpoint
|
||||
from core.db import get_latest_checkpoint
|
||||
from core.db.connection import get_session
|
||||
|
||||
checkpoint = get_latest_checkpoint(branch_id)
|
||||
if checkpoint:
|
||||
checkpoint.is_scenario = True
|
||||
checkpoint.scenario_label = args.label
|
||||
with get_session() as session:
|
||||
session.add(checkpoint)
|
||||
with get_session() as session:
|
||||
checkpoint = get_latest_checkpoint(session, branch_id)
|
||||
if checkpoint:
|
||||
checkpoint.is_scenario = True
|
||||
checkpoint.scenario_label = args.label
|
||||
session.commit()
|
||||
|
||||
logger.info("")
|
||||
|
||||
@@ -7,7 +7,7 @@ import pytest
|
||||
|
||||
from detect.models import BoundingBox, BrandDetection, Frame, PipelineStats, TextCandidate
|
||||
from core.schema.serializers._common import safe_construct
|
||||
from core.schema.serializers.detect_pipeline import (
|
||||
from core.schema.serializers.pipeline import (
|
||||
serialize_frame_meta,
|
||||
serialize_text_candidate,
|
||||
serialize_text_candidates,
|
||||
|
||||
Reference in New Issue
Block a user