Skip to content

Documentation for PyPortal.Project

Module for Cloud Portal projects.

JobResults dataclass

JobResults(
    jobs: List[Job],
    next: Optional[str] = None,
    limit: Optional[int] = None,
)

Data class used for Project.get_jobs() response.

Parameters:

Name Type Description Default
jobs List[Job]

List of all the jobs matching the filter (all jobs if no filter was passed)

required
next Optional[str]

Next token for pagination

None
limit Optional[int]

Number of jobs requested in the query

None

Project

Project(
    id: str,
    name: str,
    description: Optional[str],
    logo: Optional[str] = None,
    enabled: Optional[bool] = None,
    job_count: Optional[int] = None,
    processed_seconds: Optional[float] = None,
)

A class encapsulating Cloud Portal Project.

Intended to be initilized via the client, not directly.

Has the following accessible properties
  • name
  • description
  • id
  • enabled
  • job_count
  • processed_seconds
Warning

The job_count, enabled and processed_seconds properties are not updated in real-time and added only for filtering purposes when the projects are loaded via project get_project and get_projects methods. For the latest updates run these methods again.

Initialize Project.

Parameters:

Name Type Description Default
id str

Unique project ID.

required
name str

Name of the project.

required
description Optional[str]

Description of the project.

required
logo Optional[str]

Base 64 encoded project logo.

None
enabled Optional[bool]

Enabled status of the project.

None
job_count Optional[int]

Number of jobs in the project.

None
processed_seconds Optional[float]

Total number of processed seconds.

None

get_job async

get_job(job_id: str) -> Job

Get a specific job by id.

Parameters:

Name Type Description Default
job_id str

Unique ID to load the job.

required

Returns:

Type Description
Job

Job object.

Raises:

Type Description
PortalHTTPException

If there was an error while communicating with FacewareTech Portal.

get_jobs async

get_jobs(
    next: Optional[str] = None,
    limit: Optional[int] = None,
    status: Optional[List[JobStatus]] = None,
) -> JobResults

Get the list of all jobs in the project.

Parameters:

Name Type Description Default
next Optional[str]

the token use for pagination, will be returned with a previous get_jobs() request if the limit was set. Used to load next sequence of the jobs

None
limit Optional[int]

how many jobs to load

None
status Optional[List[JobStatus]]

filter jobs based on the JobStatus

None
Valid filtering statuses
  • JobStatus.IN_PROGRESS
  • JobStatus.QUEUED
  • JobStatus.COMPLETED
  • JobStatus.FAILED
  • JobStatus.CANCELED

Raises:

Type Description
PortalHTTPException

If there was an error while communicating with FacewareTech Portal.

ValueError

If the invalid filterting status provided.

Returns:

Type Description
JobResults

The JobResults object.

submit_job async

submit_job(
    actor_name: str,
    tracking_model: TrackingModel,
    video_file_path: str,
    calibration_image_file_path: Optional[str] = None,
    video_rotation: Optional[
        VideoRotation
    ] = VideoRotation.NONE,
    tracking_version: Optional[str] = None,
) -> Job

Will create new job and submit it for processing.

Parameters:

Name Type Description Default
actor_name str

The name of the actor for this job

required
tracking_model TrackingModel

Select if the video was recorded on Head cam or static cam

required
video_file_path str

Absolute local file system filepath to the video file. File size limit is 5TiB.

required
calibration_image_file_path Optional[str]

Absolute local file system filepath to the calibration image file

None
video_rotation Optional[VideoRotation]

The orientation of the camera when video was recorded

NONE
tracking_version Optional[str]

Tracking version for Job.

None

Raises:

Type Description
PortalHTTPException

If there was an error while communicating with FacewareTech Portal.

Returns:

Type Description
Job

Job object.