Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -614,13 +614,6 @@ def parse_llm_object_detection_response(
)


def create_classes_index(classes: List[str]) -> Dict[str, int]:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would prefer to kill import in favour of contained blocks

return {class_name: idx for idx, class_name in enumerate(classes)}


def scale_confidence(value: float) -> float:
return min(max(float(value), 0.0), 1.0)


def parse_florence2_object_detection_response(
image: WorkflowImageData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ class BlockManifest(WorkflowBlockManifest):
examples=["moondream2/moondream2_2b_jul24", "moondream2/moondream2-2b"],
)

@classmethod
def get_parameters_accepting_batches(cls) -> List[str]:
return ["images"]

@classmethod
def describe_outputs(cls) -> List[OutputDefinition]:
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@
)
from inference_models.models.base.object_detection import Detections
from inference_sdk import InferenceConfiguration, InferenceHTTPClient
from inference_sdk.http.entities import InferenceConfiguration

# Fixed, non-empty `class_id -> name` fallback map. PP-OCR emits `class_id == 0` for
# every box; the recognised text is attached per box (see module docstring), so this
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
MODAL_AVAILABLE = False
logger.info("Modal credentials not configured")

from datetime import datetime

from inference.core.workflows.core_steps.common.deserializers import (
deserialize_detections_kind,
Expand Down
1 change: 0 additions & 1 deletion inference/models/perception_encoder/vision_encoder/pe.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import torch.nn as nn
from einops import rearrange
from timm.layers import DropPath
from torch import nn
from torch.nn import functional as F
from torch.nn.init import constant_, xavier_normal_, xavier_uniform_
from torch.nn.parameter import Parameter
Expand Down