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

Update display settings #9

Merged
merged 5 commits into from
Dec 26, 2023

Conversation

desecnd
Copy link
Contributor

@desecnd desecnd commented Dec 7, 2023

This PR aims to help with working on bigger floor images and make the plotting more "flexible" for different formats

Problem

Currently some of the parameters for plotting are hardcoded and overfitted to the floor plan inside examples/ directory. This results in inproper handing of bigger image formats with whm benchmark

Given below is a example of floor plan image with resolution: (2560, 831). This is perfectly fine example as even with simple PyGUI vertical images can be easily moved around the screen.

bad_pygui

As we can see GUI "cuts" image to thumbnail with fixed size.

Other problem is hardcoded plotting parameters for whm plot.

flat_sq

There are several problems to solve:

  • Image is downscaled to fixed ratio - not much can be seen on the result plot
  • Font sizes are fixed to specific resolution
  • Legend has offset based on given image - with different ratio it will appear in different places
  • Benchmark points have fixed size

Proposed Solution

  • Remove thumbnail cutting of given images and setting hardcoded maxsize to 1200 x 850
  • Propose "heuristic" to scale font size and mark_sizes based on image dimensions
    • This solution is not perfect (numbers are mostly magic, obtained by trial-and-error) - created to "work decent" in most cases
  • Move legend to "center" below the image

Obtained Results

Following section shows obtained results after applying changes described above

whm benchmark results

Image below show that after removing maxsize and removing thumbnail we can work with full size images:

fixed_pygui

whm plot results

Following is a combination of obtained results with comparison to "baseline" (current) result

a) examples/floor_plan_white.png (651, 792)

Result before changes:

example_sq

Result after changes:

example_sq

b) flat_example.png (2560, 831)

Result before changes:

flat_sq

Result after changes:

flat_sq

c) large_example.png (2490, 2420)

Result before changes:

large_sq

Result after changes:

large_sq

Future work

A few ideas which would make working on bigger resolutions easier with whm bechmark:

  • implement zooming / moving around the floor plain - with "window" having constant size / adjustable size and being able to move freely around the image
    • this is probably harded / time consuming solution as needs changes with how GUI works
  • implement "scaling" with cmd params
    • one can launch whm benchmark with scale_x=... and scale_y=... or just scale=... params
    • this launches image but shows it with applied scaling
    • every "clicked" point generates scaled (image_x = click_x ) point on generated view, but saves real x as click_x * scale_x

The second approach is probably not that hard to implement, is easy to work with, and allows working without changing how GUI works.
There is no need to work on full-resolution images during the benchmark phase (as pixel-wise-accuracy is not needed) but it would be nice to see generated plots on full resolution of the floor plan.

@Nischay-Pro
Copy link
Owner

Hey! Nice work and thanks for the PR. If possible can you raise an issue and add your suggestions to document it.

If you can submit a commit to fix the linting, I think we can merge this PR.

@desecnd
Copy link
Contributor Author

desecnd commented Dec 18, 2023

As you suggested, I added #10 , will fix the linting errors right away

@Nischay-Pro Nischay-Pro merged commit 95bc515 into Nischay-Pro:main Dec 26, 2023
1 check 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.

Image size
2 participants