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

feat: visualize list of FSWs #11

Merged
merged 11 commits into from
Oct 19, 2024

Conversation

bipinkrish
Copy link
Contributor

@bipinkrish bipinkrish commented Oct 18, 2024

convert list of fsw to image with direction support and fixed workflow tests

@AmitMY please Squash and Merge

@bipinkrish bipinkrish changed the title add ability to visualize series of FSWs (#1) feat: visualize list of FSWs Oct 18, 2024
Copy link
Contributor

@AmitMY AmitMY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great start!

@@ -0,0 +1,31 @@
name: Lint and Test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why lint and test? when separate, they give two different information types, and when together it will first fail on lint, then test and not communicate

Copy link
Contributor Author

@bipinkrish bipinkrish Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not get you? do you not want check lint and test in same run? because it doesn't stop if one fails?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i prefer checking them in separate runs because i would like to know the status of both.

  • if test fails, i really need to fix something
  • if lint fails, it can wait for the next commit. i should fix it but less rush
    so having the two workflows gives me two status indicators

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

pyproject.toml Show resolved Hide resolved
@@ -1,6 +1,8 @@
# pylint: disable=unnecessary-lambda-assignment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally, this should be near the affected line, otherwise in the pyproject

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there were 4 lines using lambda i felt it is redundant to use it 4 time, so what do you suggest i do? in the pyproject config?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either project config or next to each line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done



# pylint: disable=too-many-locals, too-many-arguments
def signwritings_to_image(fsw_list: List[str], antialiasing: bool = True, trust_box: bool = True,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"signwritings" is very not elegant imo.
i think this can use the same function as the original, but when encountering a list, call layout

def signwriting_to_image(fsw: Union[str, List[str]], antialiasing=True, trust_box=True, embedded_color=False,
                         line_color: RGBA = (0, 0, 0, 255),
                         fill_color: RGBA = (255, 255, 255, 255), 
                         direction: Literal["horizontal", "vertical"] = "horizontal") -> Image:
    if isinstance(fsw, list):
        images = [
            signwriting_to_image(fsw_string, antialiasing, trust_box, embedded_color, line_color, fill_color)
            for fsw_string in fsw_list
        ]
        return layout_signwriting(images, direction)
   
    .....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

final_image.paste(img, paste_position(offset))
offset += offset_increment(img)

return final_image
Copy link
Contributor

@AmitMY AmitMY Oct 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not like the output of this layout function.
See here for example https://slevinski.github.io/SuttonSignWriting/characters/index.html, Hello World example or Introduction.
image

When multiple signs, there are rules on how to lay them out.
I believe this is the code used for a vertical column: https://github.com/sutton-signwriting/sgnw-components/tree/master/src/components/fsw-vp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean to say i should add gaps in between?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and center the images in the "lane"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@bipinkrish bipinkrish requested a review from AmitMY October 19, 2024 07:53
Copy link
Contributor

@AmitMY AmitMY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

@AmitMY AmitMY merged commit 93ae908 into sign-language-processing:main Oct 19, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants