Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package DoraStatus into dora python package #172

Merged
merged 3 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions apis/python/node/dora/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from enum import Enum

from .dora import *


class DoraStatus(Enum):
"""Dora status to indicate if operator `on_input` loop
should be break

Args:
Enum (u8): Status signaling to dora operator to
stop or continue the operator.
"""

CONTINUE = 0
STOP = 1
STOP_ALL = 2
6 changes: 1 addition & 5 deletions examples/python-dataflow/object_detection.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
from enum import Enum
from typing import Callable

import cv2
import numpy as np
import torch


class DoraStatus(Enum):
CONTINUE = 0
STOP = 1
from dora import DoraStatus


class Operator:
Expand Down
11 changes: 2 additions & 9 deletions examples/python-dataflow/plot.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
import os
from enum import Enum
from typing import Callable

import cv2
import numpy as np

from utils import LABELS

from dora import DoraStatus

CI = os.environ.get("CI")

font = cv2.FONT_HERSHEY_SIMPLEX


class DoraStatus(Enum):
CONTINUE = 0
STOP = 1


class Operator:
"""
Plot image and bounding box
Expand Down