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

Column Splitting job outputs file types that don't match the e2e OMR workflow #1264

Open
JoyfulGen opened this issue Mar 12, 2025 · 1 comment

Comments

@JoyfulGen
Copy link
Contributor

There are two things I need to explain prior to explaining the issue:

  1. The first jobs of the usual end-to-end OMR workflow look like this: Image The Fast Pixelwise job outputs images in a non-png format, so those images go through PNG jobs. The png images then go to the Convert to one-bit job, and those one-bit images go to the Despeckle job.

  2. Each job in Rodan has a specific file type that it can receive as an input. As a consequence, a given job can only be connected to a job that can receive the file type it produces. If you try to connect two jobs that aren't compatible, Rodan just won't let you; the input port will stay red, and nothing you can do will connect those two jobs. For example, if I want to connect an output of the Fast Pixelwise job, you can see that I can connect it to the PNG job, but I can't connect it directly to the Convert to one-bit job.

Trying.to.connect.Fast.Pixelwise.mov

Ok! So the issue is this: when you add the Column splitting job to an end-to-end OMR workflow, it goes between the Fast Pixelwise job and the three PNG jobs at the top of each column. @yinanazhou has informed me that the Column splitting job converts images both to png and to one-bit. So technically, it should be possible to remove the PNG and Convert to one-bit jobs from the workflow and connect the Column splitting job directly to the Despeckle jobs. Right? WRONG. For some reason, the Despeckle jobs refuse to be connected to the Column splitting outputs. It looks like Despeckle will only accept inputs from three jobs: Convert to one-bit, Despeckle, and Dilate.

It's absolutely possible to add Column splitting to the OMR workflow without removing the redundant jobs. I don't yet know if that redundancy is a problem or not. But it certainly adds to the confusion! I'm not sure whether the solution should be:

  1. Remove the conversion to png and one-bit from the Column splitting job;
  2. Allow Despeckle to receive inputs from Column splitting.

All thoughts welcome!

@homework36
Copy link
Contributor

homework36 commented Mar 13, 2025

Based on the code for Despeckle job below, it accepts one-bit PNG though...

input_port_types = [{
        'name': 'Onebit PNG image',
        'resource_types': ['image/onebit+png'],
        'minimum': 1,
        'maximum': 1
    }]

Column splitting outputs not only layers but also the data and here are the required output ports

output_port_types = (
        {'name': 'Staff Layer', 'minimum': 1, 'maximum': 1, 'resource_types': ['image/rgba+png']},
        {'name': 'Music Notes Layer', 'minimum': 1, 'maximum': 1, 'resource_types': ['image/rgba+png']},
        {'name': 'Text Layer', 'minimum': 1, 'maximum': 1, 'resource_types': ['image/rgba+png']},
        {
        'name': 'Column Splitting Data',
        'resource_types': ['application/json'],
        'minimum': 1,
        'maximum': 1,
        'is_list': False
        }
    )

Is there a job that converts image/rgba+png to image/onebit+png?
Since Despeckle is part of gamera, I'd recommend modifying Column splitting...

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