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

universal viewer is broken #33

Closed
keighrim opened this issue Mar 11, 2024 · 1 comment · Fixed by #34
Closed

universal viewer is broken #33

keighrim opened this issue Mar 11, 2024 · 1 comment · Fixed by #34
Labels
🐛B Something isn't working

Comments

@keighrim
Copy link
Member

Bug Description

When I click on UV tab in the visualizer, the viewer doesn't

  1. show video
  2. show timeframe-based annotation

Instead it shows an error "Unable to load manifest"

Reproduction steps

  1. open a MMIF with TimeFrame annotations
  2. click UV tab next to the default html video player

Expected behavior

  1. video show up in the UV player
  2. UV viewer provide "jump" interface for timeframe annotations

Log output

No response

Screenshots

Screenshot 2024-03-11 at 12 23 16

Additional context

No response

@keighrim keighrim added the 🐛B Something isn't working label Mar 11, 2024
@clams-bot clams-bot added this to infra Mar 11, 2024
@github-project-automation github-project-automation bot moved this to Todo in infra Mar 11, 2024
@keighrim
Copy link
Member Author

#34 includes fixes for the problems mentioned above. However, after working on this, I decided to take the UV down for now, primarily because the current UV implementation or ours doesn't provide any additional features/value to us.

  • the only annotation type on which IIIF manifest conversion works is TimeFrame (and their label) but the same functionality does exists as Thumbnail tab.

    mmif-visualizer/utils.py

    Lines 194 to 197 in 91cec33

    tabname = "Thumbnails-%s" % ocr_view.id
    visualization = render_template("pre-ocr.html", view_id=ocr_view.id, tabname=tabname, mmif_id=viz_id)
    tabs.append((tabname, visualization))
    app.logger.debug(f"Prepared a Thumbnails Tab: {tabs[-1][0]}")
  • then, even the only conversion has been disabled from the very beginning of the integration UV into mmif-viz, anyway
    # for annotation in view.annotations:
    # # TODO: TimeUnits generated by Kaldi have no "timeUnit" or "unit" property.
    # The mmif documentation does specify a "unit" property, but the Kaldi
    # ASR doesn't seem to include that in annotations.
    # if annotation.at_type == AnnotationTypes.TimeFrame:
    # if 'unit' in annotation.properties:
    # annotation_unit = annotation.properties['unit']
    # elif 'unit' in view.metadata.parameters:
    # annotation_unit = view.metadata.parameters['unit']
    # else:
    # raise Exception("Error finding timeframe unit.")
    # frame_type = annotation.properties["frameType"]
    # if annotation_unit == "frame":
    # start_fn = int(annotation.properties["start"])
    # end_fn = int(annotation.properties["end"])
    # frame_rate = 29.97
    # start_sec = int(start_fn // frame_rate)
    # end_sec = int(end_fn // frame_rate)
    # elif annotation_unit == "milliseconds":
    # start_milli = int(annotation.properties["start"])
    # end_milli = int(annotation.properties["end"])
    # start_sec = int(start_milli // 1000)
    # end_sec = int(end_milli // 1000)
    # else:
    # continue
    # structure = {
    # "id": f"http://0.0.0.0:5000/mmif_example_manifest.json/range/{range_id}",
    # "type": "Range",
    # "label": f"{frame_type.capitalize()}",
    # "members": [
    # {
    # "id": f"http://0.0.0.0:5000/mmif_example_manifest.json/canvas/{1}#t={start_sec},{end_sec}",
    # # need to align id here to support more than one document
    # "type": "Canvas"
    # }
    # ]
    # }
    # view_range["members"].append(structure)

For the future, we can work on a "consumer" for targeting more general conversion between MMIF and IIIF, but I don't necessarily think that has to be "integrated" into mmif-viz.

@github-project-automation github-project-automation bot moved this from Todo to Done in infra Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛B Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant