Unverified Commit d499abf2 authored by gy77's avatar gy77 Committed by GitHub
Browse files

Add type hints in mmcv/ops/pixel_group.py (#2016)



* add typehint in mmcv/ops/pixel_group.py

* fix indent

* fix indent

* improve format
Co-authored-by: default avatarZaida Zhou <58739961+zhouzaida@users.noreply.github.com>
parent 9ea55bad
# Copyright (c) OpenMMLab. All rights reserved.
from typing import List, Union
import numpy as np
import torch
from torch import Tensor
from ..utils import ext_loader
ext_module = ext_loader.load_ext('_ext', ['pixel_group'])
def pixel_group(score, mask, embedding, kernel_label, kernel_contour,
kernel_region_num, distance_threshold):
def pixel_group(
score: Union[np.ndarray, Tensor],
mask: Union[np.ndarray, Tensor],
embedding: Union[np.ndarray, Tensor],
kernel_label: Union[np.ndarray, Tensor],
kernel_contour: Union[np.ndarray, Tensor],
kernel_region_num: int,
distance_threshold: float,
) -> List[List[float]]:
"""Group pixels into text instances, which is widely used text detection
methods.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment