Skip to content

Commit

Permalink
Style
Browse files Browse the repository at this point in the history
  • Loading branch information
probicheaux committed Jul 19, 2024
1 parent 05c3408 commit 7b48ed9
Show file tree
Hide file tree
Showing 39 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion inference/core/interfaces/camera/video_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from typing import Any, Callable, Dict, List, Optional, Protocol, Tuple, Union

import cv2
import supervision as sv
from numpy import ndarray

import supervision as sv
from inference.core import logger
from inference.core.env import (
DEFAULT_ADAPTIVE_MODE_READER_PACE_TOLERANCE,
Expand Down
2 changes: 1 addition & 1 deletion inference/core/interfaces/http/orjson_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
from typing import Any, Dict, List, Optional, Union

import orjson
import supervision as sv
from fastapi.responses import ORJSONResponse
from pydantic import BaseModel

import supervision as sv
from inference.core.entities.responses.inference import InferenceResponse
from inference.core.utils.function import deprecated
from inference.core.utils.image_utils import ImageType
Expand Down
4 changes: 2 additions & 2 deletions inference/core/interfaces/stream/sinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

import cv2
import numpy as np

import supervision as sv
from supervision.annotators.base import BaseAnnotator

from inference.core import logger
from inference.core.active_learning.middlewares import ActiveLearningMiddleware
from inference.core.interfaces.camera.entities import VideoFrame
from inference.core.interfaces.stream.entities import SinkHandler
from inference.core.interfaces.stream.utils import wrap_in_list
from inference.core.utils.drawing import create_tiles
from inference.core.utils.preprocess import letterbox_image
from supervision.annotators.base import BaseAnnotator

DEFAULT_BBOX_ANNOTATOR = sv.BoundingBoxAnnotator()
DEFAULT_LABEL_ANNOTATOR = sv.LabelAnnotator()
Expand Down
2 changes: 1 addition & 1 deletion inference/core/interfaces/stream/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@

import cv2
import numpy as np
import supervision as sv
from PIL import Image

import inference.core.entities.requests.inference
import supervision as sv
from inference.core.active_learning.middlewares import (
NullActiveLearningMiddleware,
ThreadingActiveLearningMiddleware,
Expand Down
1 change: 1 addition & 0 deletions inference/core/interfaces/stream/watchdog.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from typing import Any, Deque, Dict, Iterable, List, Optional, TypeVar

import supervision as sv

from inference.core.interfaces.camera.entities import (
StatusUpdate,
UpdateSeverity,
Expand Down
2 changes: 1 addition & 1 deletion inference/core/interfaces/udp/udp_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import cv2
import numpy as np
import supervision as sv
from PIL import Image

import inference.core.entities.requests.inference
import supervision as sv
from inference.core.active_learning.middlewares import (
NullActiveLearningMiddleware,
ThreadingActiveLearningMiddleware,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
from typing import Any, Callable, Dict, List

import numpy as np

import supervision as sv
from supervision import Position

from inference.core.workflows.core_steps.common.query_language.entities.enums import (
DetectionsProperty,
DetectionsSelectionMode,
Expand All @@ -18,7 +19,6 @@
from inference.core.workflows.core_steps.common.query_language.operations.utils import (
safe_stringify,
)
from supervision import Position

PROPERTIES_EXTRACTORS = {
DetectionsProperty.CONFIDENCE: lambda detections: detections.confidence.tolist(),
Expand Down
2 changes: 1 addition & 1 deletion inference/core/workflows/core_steps/common/serializers.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Any, Dict, List

import numpy as np

import supervision as sv

from inference.core.workflows.constants import (
CLASS_ID_KEY,
CLASS_NAME_KEY,
Expand Down
4 changes: 2 additions & 2 deletions inference/core/workflows/core_steps/common/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
from typing import Any, Dict, Iterable, List, Optional, Union

import numpy as np

import supervision as sv
from supervision.config import CLASS_NAME_DATA_FIELD

from inference.core.entities.requests.clip import ClipCompareRequest
from inference.core.entities.requests.cogvlm import CogVLMInferenceRequest
from inference.core.entities.requests.doctr import DoctrOCRInferenceRequest
Expand Down Expand Up @@ -42,7 +43,6 @@
OriginCoordinatesSystem,
WorkflowImageData,
)
from supervision.config import CLASS_NAME_DATA_FIELD


def load_core_model(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
from uuid import uuid4

import numpy as np
import supervision as sv
from pydantic import ConfigDict, Field
from supervision.config import CLASS_NAME_DATA_FIELD

import supervision as sv
from inference.core.workflows.constants import DETECTION_ID_KEY, PARENT_ID_KEY
from inference.core.workflows.entities.base import Batch, OutputDefinition
from inference.core.workflows.entities.types import (
Expand All @@ -19,7 +20,6 @@
WorkflowBlock,
WorkflowBlockManifest,
)
from supervision.config import CLASS_NAME_DATA_FIELD

LONG_DESCRIPTION = """
Combine results of detection model with classification results performed separately for
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
from uuid import uuid4

import numpy as np
import supervision as sv
from pydantic import AliasChoices, ConfigDict, Field, PositiveInt

import supervision as sv
from inference.core.workflows.constants import (
DETECTION_ID_KEY,
IMAGE_DIMENSIONS_KEY,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
from uuid import uuid4

import numpy as np
import supervision as sv
import zxingcpp
from pydantic import ConfigDict
from supervision.config import CLASS_NAME_DATA_FIELD

import supervision as sv
from inference.core.workflows.constants import (
DETECTED_CODE_KEY,
DETECTION_ID_KEY,
Expand All @@ -31,7 +32,6 @@
WorkflowBlock,
WorkflowBlockManifest,
)
from supervision.config import CLASS_NAME_DATA_FIELD

LONG_DESCRIPTION = """
Detect the location of barcodes in an image.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@

import cv2
import numpy as np
import supervision as sv
from pydantic import AliasChoices, ConfigDict, Field
from supervision.config import CLASS_NAME_DATA_FIELD

import supervision as sv
from inference.core.workflows.constants import (
DETECTED_CODE_KEY,
DETECTION_ID_KEY,
Expand All @@ -31,7 +32,6 @@
WorkflowBlock,
WorkflowBlockManifest,
)
from supervision.config import CLASS_NAME_DATA_FIELD

LONG_DESCRIPTION = """
Detect the location of a QR code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from typing import Any, Dict, List, Literal, Optional, Tuple, Type, Union
from uuid import uuid4

import supervision as sv
from fastapi import BackgroundTasks
from pydantic import ConfigDict, Field

import supervision as sv
from inference.core.active_learning.cache_operations import (
return_strategy_credit,
use_credit_of_matching_strategy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from typing import Dict, List, Literal, Optional, Type, Union

import numpy as np
import supervision as sv
from pydantic import AliasChoices, ConfigDict, Field, PositiveInt

import supervision as sv
from inference.core.workflows.constants import DETECTION_ID_KEY, PARENT_ID_KEY
from inference.core.workflows.entities.base import Batch, OutputDefinition
from inference.core.workflows.entities.types import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Any, Dict, List, Literal, Type, Union

import supervision as sv
from pydantic import ConfigDict, Field

import supervision as sv
from inference.core.workflows.core_steps.common.query_language.entities.operations import (
AllOperationsType,
OperationDefinition,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from copy import copy
from typing import Any, Dict, List, Literal, Type, Union

import supervision as sv
from pydantic import ConfigDict, Field

import supervision as sv
from inference.core.workflows.core_steps.common.query_language.entities.operations import (
DEFAULT_OPERAND_NAME,
AllOperationsType,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from dataclasses import replace
from typing import Dict, List, Literal, Optional, Type, Union

import supervision as sv
from pydantic import AliasChoices, ConfigDict, Field

import supervision as sv
from inference.core.workflows.constants import DETECTION_ID_KEY
from inference.core.workflows.entities.base import (
Batch,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import cv2 as cv
import numpy as np
import supervision as sv
from pydantic import ConfigDict, Field

import supervision as sv
from inference.core.workflows.entities.base import Batch, OutputDefinition
from inference.core.workflows.entities.types import (
BATCH_OF_INSTANCE_SEGMENTATION_PREDICTION_KIND,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

import cv2 as cv
import numpy as np
import supervision as sv
from pydantic import AliasChoices, ConfigDict, Field

import supervision as sv
from inference.core.logger import logger
from inference.core.workflows.constants import KEYPOINTS_XY_KEY_IN_SV_DETECTIONS
from inference.core.workflows.entities.base import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import cv2
import numpy as np

from supervision.annotators.base import BaseAnnotator, ImageType
from supervision.detection.core import Detections
from supervision.draw.color import Color
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import List, Literal, Optional, Type, Union

import supervision as sv
from pydantic import ConfigDict, Field

import supervision as sv
from inference.core.workflows.core_steps.visualizations.annotators.background_color import (
BackgroundColorAnnotator,
)
Expand Down
2 changes: 1 addition & 1 deletion inference/core/workflows/core_steps/visualizations/base.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from abc import ABC, abstractmethod
from typing import List, Literal, Optional, Type, Union

import supervision as sv
from pydantic import AliasChoices, ConfigDict, Field

import supervision as sv
from inference.core.workflows.core_steps.visualizations.utils import str_to_color
from inference.core.workflows.entities.base import OutputDefinition, WorkflowImageData
from inference.core.workflows.entities.types import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from abc import ABC, abstractmethod
from typing import List, Literal, Optional, Union

import supervision as sv
from pydantic import Field

import supervision as sv
from inference.core.workflows.core_steps.visualizations.base import (
VisualizationBlock,
VisualizationManifest,
Expand Down
2 changes: 1 addition & 1 deletion inference/core/workflows/core_steps/visualizations/blur.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import Literal, Optional, Type, Union

import supervision as sv
from pydantic import ConfigDict, Field

import supervision as sv
from inference.core.workflows.core_steps.visualizations.base import (
OUTPUT_IMAGE_KEY,
VisualizationBlock,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import List, Literal, Optional, Type, Union

import supervision as sv
from pydantic import ConfigDict, Field

import supervision as sv
from inference.core.workflows.core_steps.visualizations.base import OUTPUT_IMAGE_KEY
from inference.core.workflows.core_steps.visualizations.base_colorable import (
ColorableVisualizationBlock,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import List, Literal, Optional, Type, Union

import supervision as sv
from pydantic import ConfigDict, Field

import supervision as sv
from inference.core.workflows.core_steps.visualizations.base import OUTPUT_IMAGE_KEY
from inference.core.workflows.core_steps.visualizations.base_colorable import (
ColorableVisualizationBlock,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import List, Literal, Optional, Type, Union

import supervision as sv
from pydantic import ConfigDict, Field

import supervision as sv
from inference.core.workflows.core_steps.visualizations.base import OUTPUT_IMAGE_KEY
from inference.core.workflows.core_steps.visualizations.base_colorable import (
ColorableVisualizationBlock,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import List, Literal, Optional, Type, Union

import supervision as sv
from pydantic import ConfigDict, Field

import supervision as sv
from inference.core.workflows.core_steps.visualizations.base import OUTPUT_IMAGE_KEY
from inference.core.workflows.core_steps.visualizations.base_colorable import (
ColorableVisualizationBlock,
Expand Down
2 changes: 1 addition & 1 deletion inference/core/workflows/core_steps/visualizations/crop.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import List, Literal, Optional, Type, Union

import supervision as sv
from pydantic import ConfigDict, Field

import supervision as sv
from inference.core.workflows.core_steps.visualizations.base import OUTPUT_IMAGE_KEY
from inference.core.workflows.core_steps.visualizations.base_colorable import (
ColorableVisualizationBlock,
Expand Down
2 changes: 1 addition & 1 deletion inference/core/workflows/core_steps/visualizations/dot.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import List, Literal, Optional, Type, Union

import supervision as sv
from pydantic import ConfigDict, Field

import supervision as sv
from inference.core.workflows.core_steps.visualizations.base import OUTPUT_IMAGE_KEY
from inference.core.workflows.core_steps.visualizations.base_colorable import (
ColorableVisualizationBlock,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import List, Literal, Optional, Type, Union

import supervision as sv
from pydantic import ConfigDict, Field

import supervision as sv
from inference.core.workflows.core_steps.visualizations.base import OUTPUT_IMAGE_KEY
from inference.core.workflows.core_steps.visualizations.base_colorable import (
ColorableVisualizationBlock,
Expand Down
2 changes: 1 addition & 1 deletion inference/core/workflows/core_steps/visualizations/halo.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from typing import List, Literal, Optional, Type, Union

import supervision as sv
from pydantic import ConfigDict, Field

import supervision as sv
from inference.core.workflows.core_steps.visualizations.base import OUTPUT_IMAGE_KEY
from inference.core.workflows.core_steps.visualizations.base_colorable import (
ColorableVisualizationBlock,
Expand Down
Loading

0 comments on commit 7b48ed9

Please sign in to comment.