From 5649c0cbb8c989aebd16722ea0b7396e74e774d2 Mon Sep 17 00:00:00 2001 From: Yih-Dar <2521628+ydshieh@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:42:55 +0100 Subject: [PATCH] Fix `DepthEstimationPipeline`'s docstring (#28733) * fix * fix * Fix --------- Co-authored-by: ydshieh --- src/transformers/pipelines/depth_estimation.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/transformers/pipelines/depth_estimation.py b/src/transformers/pipelines/depth_estimation.py index c8d0cad6fc77..dbc1e1344398 100644 --- a/src/transformers/pipelines/depth_estimation.py +++ b/src/transformers/pipelines/depth_estimation.py @@ -52,7 +52,7 @@ def __init__(self, *args, **kwargs): def __call__(self, images: Union[str, List[str], "Image.Image", List["Image.Image"]], **kwargs): """ - Assign labels to the image(s) passed as inputs. + Predict the depth(s) of the image(s) passed as inputs. Args: images (`str`, `List[str]`, `PIL.Image` or `List[PIL.Image]`): @@ -65,9 +65,6 @@ def __call__(self, images: Union[str, List[str], "Image.Image", List["Image.Imag The pipeline accepts either a single image or a batch of images, which must then be passed as a string. Images in a batch must all be in the same format: all as http links, all as local paths, or all as PIL images. - top_k (`int`, *optional*, defaults to 5): - The number of top labels that will be returned by the pipeline. If the provided number is higher than - the number of labels available in the model configuration, it will default to the number of labels. timeout (`float`, *optional*, defaults to None): The maximum time in seconds to wait for fetching images from the web. If None, no timeout is set and the call may block forever. @@ -79,8 +76,8 @@ def __call__(self, images: Union[str, List[str], "Image.Image", List["Image.Imag The dictionaries contain the following keys: - - **label** (`str`) -- The label identified by the model. - - **score** (`int`) -- The score attributed by the model for that label. + - **predicted_depth** (`torch.Tensor`) -- The predicted depth by the model as a `torch.Tensor`. + - **depth** (`PIL.Image`) -- The predicted depth by the model as a `PIL.Image`. """ return super().__call__(images, **kwargs)