Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Representation of video annotations #9

Open
GermanHydrogen opened this issue Feb 11, 2025 · 4 comments
Open

Representation of video annotations #9

GermanHydrogen opened this issue Feb 11, 2025 · 4 comments

Comments

@GermanHydrogen
Copy link

If I understand correctly, BIIGLE represents (time-dependent) video annotations using the image-annotations:frame attribute, e.g., like this:

{
  "image-set-header": {
    "image-annotation-creators": [
      {
        "id": "https://orcid.org/0009-0001-1994-0399",
        "name": "Christopher Krämmer"
      }
    ],
    "image-annotation-labels": [
      {
        "id": "urn:lsid:marinespecies.org:taxname:281088",
        "name": "Hoplosebastes armatus Schmidt,1929"
      }
    ]
  },
  "image-set-items": {
    "video.mp4": [
      {
        "image-datetime": "2024-07-17T00:32:18.000000",
        "image-annotations": [
          {
            "shape": "rectangle",
            "coordinates": [
              [
                2274.28,
                1766.4,
                2299.44,
                1767.76,
                2297.96,
                1795.1,
                2272.8,
                1793.74
              ],
              [
                2274.28,
                1766.4,
                2299.44,
                1767.76,
                2297.96,
                1795.1,
                2272.8,
                1793.74
              ]
            ],
            "labels": [
              {
                "label": "urn:lsid:marinespecies.org:taxname:281088",
                "annotator": "https://orcid.org/0009-0001-1994-0399",
                "created-at": "2024-11-22T06:03:56.655940+01:00"
              }
            ],
            "frames": [
              1,
              10
            ]
          }
        ]
      }
    ]
  }
}

This is in contrast to the representation of time dependent information related to a video, which uses multiple list entries with different values in image-datetime for one video file. Video annotations could also be expressed this way:

{
  "image-set-header": {
    "image-annotation-creators": [
      {
        "id": "https://orcid.org/0009-0001-1994-0399",
        "name": "Christopher Krämmer"
      }
    ],
    "image-annotation-labels": [
      {
        "id": "urn:lsid:marinespecies.org:taxname:281088",
        "name": "Hoplosebastes armatus Schmidt,1929"
      }
    ]
  },
  "image-set-items": {
    "video.mp4": [
      {
        "image-datetime": "2024-07-17T00:32:18.000000"
      },
      {
        "image-datetime": "2024-07-17T00:32:19.000000",
        "image-annotations": [
          {
            "shape": "rectangle",
            "coordinates": [
              [
                2274.28,
                1766.4,
                2299.44,
                1767.76,
                2297.96,
                1795.1,
                2272.8,
                1793.74
              ]
            ],
            "labels": [
              {
                "label": "urn:lsid:marinespecies.org:taxname:281088",
                "annotator": "https://orcid.org/0009-0001-1994-0399",
                "created-at": "2024-11-22T06:03:56.655940+01:00"
              }
            ]
          }
        ]
      },
      {
        "image-datetime": "2024-07-17T00:32:28.000000",
        "image-annotations": [
          {
            "shape": "rectangle",
            "coordinates": [
              [
                2274.28,
                1766.4,
                2299.44,
                1767.76,
                2297.96,
                1795.1,
                2272.8,
                1793.74
              ]
            ],
            "labels": [
              {
                "label": "urn:lsid:marinespecies.org:taxname:281088",
                "annotator": "https://orcid.org/0009-0001-1994-0399",
                "created-at": "2024-11-22T06:03:56.655940+01:00"
              }
            ]
          }
        ]
      }
    ]
  }
}

From a perspective of data consistency, I would prefer if iFDOs would only offer one way to represent time dependent data.
Is my assumption correct, that both representations encode the same information for video annotations? Could BIIGLE use the second representation?

This is related to https://codebase.helmholtz.cloud/datahub/marehub/ag-videosimages/fair-marine-images/-/issues/69

@GermanHydrogen
Copy link
Author

@ckraemme

@mzur
Copy link
Member

mzur commented Feb 11, 2025

I see what you mean now. The two representations do not encode the same information. In the second variant, you don't know if there are two (single-frame) rectangle annotations or one (moving) annotation.

In addition, BIIGLE could only provide the second variant, if it knows the timestamp of the video. I'm not sure if this is a mandatory field in an iFDO but you can also annotate videos without this metadata in BIIGLE.

@GermanHydrogen
Copy link
Author

So you use the last entry in image-annotations:frame to determine the last frame of an annotation?

@mzur
Copy link
Member

mzur commented Feb 12, 2025

I don't see how this relates to the question above but yes, the frames determine when the annotation is visible in the video.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants