Skip to content

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
chanwutk committed Feb 25, 2024
1 parent 03aacd5 commit 2e02c5d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions spatialyze/video_processor/utils/insert_trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
from psycopg2.sql import SQL, Literal

from ..types import Float3
from ..utils.prepare_trajectory import Trajectory
from .infer_heading import infer_heading

if TYPE_CHECKING:
from ...database import Database
from .types import Trajectory


def insert_trajectory(
database: "Database",
trajectory: Trajectory,
trajectory: "Trajectory",
):
(
item_id,
Expand Down
11 changes: 1 addition & 10 deletions spatialyze/video_processor/utils/prepare_trajectory.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
import datetime
from typing import NamedTuple

from ..camera_config import CameraConfig
from ..stream.strongsort import TrackingResult
from ..types import Float3


class Trajectory(NamedTuple):
obj_id: int | str
ids: list[int]
camera_id: str
object_type: str
pairs: list[Float3]
itemHeadings: list[float | None]
from .types import Trajectory


def prepare_trajectory(
Expand Down
12 changes: 12 additions & 0 deletions spatialyze/video_processor/utils/types.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from typing import NamedTuple

from ..types import Float3


class Trajectory(NamedTuple):
obj_id: int | str
ids: list[int]
camera_id: str
object_type: str
pairs: list[Float3]
itemHeadings: list[float | None]

0 comments on commit 2e02c5d

Please sign in to comment.