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

Add new Landscape Mode feature to App #32

Merged
merged 33 commits into from
Aug 11, 2024

Conversation

john-rocky
Copy link
Contributor

@john-rocky john-rocky commented Jun 14, 2024

Add landscape mode.
The UI will be laid out according to the device orientation and video orientation will be displayed correctly. The detection box will also be displayed correctly. If the app has a preferred landscape UI, please let me know.

🛠️ PR Summary

Made with ❤️ by Ultralytics Actions

🌟 Summary

This PR improves the iOS YOLO app's adaptability to different device orientations and includes various code optimizations and enhancements.

📊 Key Changes

  • Orientation Handling:
    • Added new logic to handle video orientation based on device orientation.
    • Updated layout and UI elements to adapt to landscape and portrait modes.
  • Video Capture Enhancements:
    • Introduced updateVideoOrientation method to dynamically adjust video capture orientation.
  • UI & Layout Updates:
    • Modified storyboard files for better UI consistency.
    • Added support for landscape mode UI elements.
    • Updated constraints and positioning for various UI components.
  • Code Clean-up:
    • Refined and restructured code for better readability and maintenance.
    • Fixed indentation and formatting issues.

🎯 Purpose & Impact

  • Enhanced User Experience:
    • 🖼️ Improved UI adaptability ensures a smoother experience when switching between portrait and landscape modes.
  • Better Video Handling:
    • 📹 Accurate video orientation adjustments prevent incorrect display on rotation.
  • Improved Maintainability:
    • 🛠️ Code refinements facilitate easier future updates and bug fixes.
  • Consistency in UI:
    • 🎨 Updates in storyboard files maintain a consistent look and feel across the app.

Copy link
Member

@ambitious-octopus ambitious-octopus left a comment

Choose a reason for hiding this comment

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

Hey @john-rocky I was testing the app and noticed that this bar takes up 1/5 of the available space! Is it possible to remove it or make it transparent?

image

@john-rocky
Copy link
Contributor Author

In landscape mode, the background color of the bottom toolbar has been made transparent so that the preview can be seen more widely.
Also, the share button now works correctly in landscape mode.
Other UI layouts have been kept as original as possible.
If you have any additional layout requests, please let me know and I will make corrections.

IMG_3017

@ultralytics ultralytics deleted a comment from pderrenger Jul 9, 2024
Copy link
Member

@ambitious-octopus ambitious-octopus left a comment

Choose a reason for hiding this comment

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

@john-rocky Landscape mode does not work in iPad 9th generation with iPadOS 17.5.1

@john-rocky
Copy link
Contributor Author

@ambitious-octopus
I don't have an iPad with me right now, so it would be helpful if you could tell me how it doesn't work.
Does it crash?
Does the layout get messed up?
Does the camera preview have a strange orientation?

etc.

Copy link
Member

@ambitious-octopus ambitious-octopus left a comment

Choose a reason for hiding this comment

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

@john-rocky The app simply doesn't rotate when you put the device in landscape mode! Let me test it again and I'll give you more precise information!

Copy link
Member

@ambitious-octopus ambitious-octopus left a comment

Choose a reason for hiding this comment

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

I think this is the first PR to be merged, but this PR also contains changes related to YOLO-human. @john-rocky Can you make this PR integrate only landscape mode by removing all changes related to YOLO-human?

@john-rocky
Copy link
Contributor Author

@ambitious-octopus
OK, I will remove all changes related to YOLO-human.

@john-rocky
Copy link
Contributor Author

john-rocky commented Jul 29, 2024

@ambitious-octopus
I removed all changes related to YOLO-human.
Now the landscape mode works only in detect task.
In other words, this branch is the main branch with just the landscape added.
IMG_3424

Copy link
Member

@ambitious-octopus ambitious-octopus left a comment

Choose a reason for hiding this comment

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

@glenn-jocher This PR is the first step towards integrating into the main branch! While I haven't been able to test it on a Mac due to lack of access, I did test it on an iPhone 15 using TestFlight, and it worked correctly.

Copy link
Member

@ambitious-octopus ambitious-octopus left a comment

Choose a reason for hiding this comment

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

Hey @john-rocky , I added some comments! Have you tested this branch?

YOLO.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
YOLO.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
YOLO.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
YOLO.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
YOLO.xcodeproj/project.pbxproj Outdated Show resolved Hide resolved
YOLO/Info.plist Outdated Show resolved Hide resolved
YOLO/LaunchScreen.storyboard Show resolved Hide resolved
YOLO/LaunchScreen.storyboard Show resolved Hide resolved
YOLO/Main.storyboard Show resolved Hide resolved
YOLO/Main.storyboard Show resolved Hide resolved
@john-rocky
Copy link
Contributor Author

@ambitious-octopus
I reverted the changes in project.pbxproj.
And I have tested this branch and it works fine.

Copy link
Member

@ambitious-octopus ambitious-octopus left a comment

Choose a reason for hiding this comment

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

@john-rocky Please keep the latest versions of plugins. Can you test it please?

@john-rocky
Copy link
Contributor Author

@ambitious-octopus
I updated the plugin to the latest version, tested it on my iPhone and everything worked fine.

YOLO/Info.plist Show resolved Hide resolved
@glenn-jocher glenn-jocher changed the title Landscapemode Add new Landscape Mode feature to App Aug 11, 2024
@glenn-jocher
Copy link
Member

@john-rocky @ambitious-octopus hi guys! I implemented the swift formatting in main and in this branch, but for some reason GitHub has problems reconciling the two and says there are conflicts. I've gone ahead and resolved the conflicts in this PR, but I see that it is now showing conflicts in all open PRs (!!).

What a mess. I meant to simplify things but it looks like I've really created a problem now with the other PRs.

@ambitious-octopus let's sync up on the YOLO meeting tomorrow to discuss next steps.

This PR seems good to go now, so I'm going to merge, and then let's focus on the next PRs here.

@john-rocky I think let's wait on the Human PRs for now, we want to focus first on the simplest improvements to the base app, and then begin to add Tasks like Segment and Pose, but we want to do this an minimally as possible, as users are expecting this PR to be a simple place to start, so we do not want to overdo it with code and features as much as possible.

@glenn-jocher glenn-jocher merged commit 494eeda into ultralytics:main Aug 11, 2024
2 checks passed
@glenn-jocher
Copy link
Member

@john-rocky @ambitious-octopus PR merged!! Thanks for the amazing effort on this!

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.

4 participants