class_docstr: Object detector based on https://github.com/open-mmlab/mmdetection.
class_docstr_tok: ["Object","detector","based","on","https",":","\/\/github.com\/open-mmlab\/mmdetection","."]
code: def _get_image_url(self, task):
      image_url = task["data"].get(self.value) or task["data"].get(
          DATA_UNDEFINED_NAME
      )
      if image_url.startswith("s3://"):
          # presign s3 url
          r = urlparse(image_url, allow_fragments=False)
          bucket_name = r.netloc
          key = r.path.lstrip("/")
          client = boto3.client("s3")
          try:
              image_url = client.generate_presigned_url(
                  ClientMethod="get_object",
                  Params={"Bucket": bucket_name, "Key": key},
              )
          except ClientError as exc:
              logger.warning(
                  f"Can't generate presigned URL for {image_url}. Reason: {exc}"  # noqa E501
              )
      return image_url
  
file_path: mmdetection/projects/LabelStudio/backend_template/mmdetection.py
imports: import io
  import json
  import logging
  import os
  from urllib.parse import urlparse
  import boto3
  from botocore.exceptions import ClientError
  from label_studio_ml.model import LabelStudioMLBase
  from label_studio_ml.utils import DATA_UNDEFINED_NAME, get_image_size, get_single_tag_keys
  from label_studio_tools.core.utils.io import get_data_dir
  from mmdet.apis import inference_detector, init_detector
label_desc: Use image node_id 2 for calling the MMDetection obj's underlying member method code with example usage: obj._get_image_url(task) and returns: image_url