Skip to content

Commit

Permalink
fix overriding with wrong Session object
Browse files Browse the repository at this point in the history
  • Loading branch information
max-unfinity committed Sep 17, 2024
1 parent c44c613 commit 2607ed5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/functions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import supervisely as sly
from supervisely.nn import TaskType
from supervisely.nn.inference import Session
from supervisely.nn.inference import SessionJSON

import src.globals as g

Expand All @@ -16,8 +16,10 @@ def get_project_classes():


def get_model_info():
g.session = Session(g.api, g.session_id)
if g.session is None:
g.session = SessionJSON(g.api, g.session_id)
model_meta = g.session.get_model_meta()
model_meta = sly.ProjectMeta.from_json(model_meta)
session_info = g.session.get_session_info()
return model_meta.obj_classes, session_info["task type"]

Expand Down

0 comments on commit 2607ed5

Please sign in to comment.