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

Alobugdays - 12 black square title #275

Merged
merged 3 commits into from
Nov 18, 2022
Merged

Conversation

eleonorefrcs
Copy link
Contributor

@eleonorefrcs eleonorefrcs commented Nov 17, 2022

This PR improves the black square title displayed on views.
Issue: #12

  • Add parameter to activate/deactivate title (default to True)
    Test code (with add_title=False):
from aloscene import Frame
from alodataset import CocoBaseDataset

coco_dataset = CocoBaseDataset(sample=False, img_folder="test2017")
#checking if regular getitem works
stuff=coco_dataset.getitem(0)
stuff.get_view(add_title=False).render()

#check if dataloader works
for f, frames in enumerate(coco_dataset.train_loader(batch_size=2)):
    frames = Frame.batch_list(frames)
    frames.get_view().render()
    if f > 1:
        break
  • Improve title rendering: Use existing put_adapative_cv2_text() to add title in Renderer class. Improve the function to adapt text size to frame size. Decrease text size if text is too long.
    Test code:
from aloscene import Frame
from alodataset import CocoBaseDataset

coco_dataset = CocoBaseDataset(sample=False, img_folder="test2017")
#checking if regular getitem works
stuff=coco_dataset.getitem(0)
stuff.get_view(add_title=True).render()

#check if dataloader works
for f, frames in enumerate(coco_dataset.train_loader(batch_size=2)):
    frames = Frame.batch_list(frames)
    frames.get_view().render()
    if f > 1:
        break

This pull request includes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@anhtu293 anhtu293 self-requested a review November 17, 2022 15:18
@anhtu293
Copy link
Contributor

i dont see any title when i use your code to test. can you give a better example ?

@eleonorefrcs
Copy link
Contributor Author

i dont see any title when i use your code to test. can you give a better example ?

Even with the second one? get_view(add_title=**True**)

You should see:
Screenshot from 2022-11-17 14-46-43
Screenshot from 2022-11-17 17-02-20

@anhtu293 anhtu293 merged commit 355aca6 into alobugdays Nov 18, 2022
@eleonorefrcs eleonorefrcs deleted the 12-black-square-title branch November 18, 2022 08:53
@eleonorefrcs eleonorefrcs mentioned this pull request Nov 18, 2022
4 tasks
@eleonorefrcs eleonorefrcs self-assigned this Nov 18, 2022
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