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

Ultralytics Actions JSON, CSS and autolabel support #51

Merged
merged 5 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
# Ultralytics 🚀 - AGPL-3.0 license
# Ultralytics 🚀 - AGPL-3.0 License https://ultralytics.com/license
# Ultralytics Actions https://github.com/ultralytics/actions
# This workflow automatically formats code and documentation in PRs to official Ultralytics standards

name: Ultralytics Actions

on:
push:
branches: [main]
issues:
types: [opened]
pull_request_target:
branches: [main]
types: [opened, closed, synchronize]
types: [opened, closed, synchronize, review_requested]

jobs:
format:
runs-on: ubuntu-latest
runs-on: macos-latest
steps:
- name: Run Ultralytics Formatting
uses: ultralytics/actions@main
with:
token: ${{ secrets.GITHUB_TOKEN }} # automatically generated, do not modify
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || secrets.GITHUB_TOKEN }} # note GITHUB_TOKEN automatically generated
labels: true # autolabel issues and PRs
python: true # format Python code and docstrings
markdown: true # format Markdown and YAML
prettier: true # format YAML, JSON, Markdown and CSS
swift: true # format Swift code
spelling: true # check spelling
links: false # check broken links
summary: true # print PR summary with GPT4 (requires 'openai_api_key' or 'openai_azure_api_key' and 'openai_azure_endpoint')
summary: true # print PR summary with GPT4o (requires 'openai_api_key')
openai_azure_api_key: ${{ secrets.OPENAI_AZURE_API_KEY }}
openai_azure_endpoint: ${{ secrets.OPENAI_AZURE_ENDPOINT }}
2 changes: 1 addition & 1 deletion example/ios/Runner/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import UIKit
import Flutter
import UIKit

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
Expand Down
160 changes: 80 additions & 80 deletions example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
@@ -1,122 +1,122 @@
{
"images" : [
"images": [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
"size": "20x20",
"idiom": "iphone",
"filename": "Icon-App-20x20@2x.png",
"scale": "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "Icon-App-20x20@3x.png",
"scale" : "3x"
"size": "20x20",
"idiom": "iphone",
"filename": "Icon-App-20x20@3x.png",
"scale": "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
"size": "29x29",
"idiom": "iphone",
"filename": "Icon-App-29x29@1x.png",
"scale": "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
"size": "29x29",
"idiom": "iphone",
"filename": "Icon-App-29x29@2x.png",
"scale": "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "Icon-App-29x29@3x.png",
"scale" : "3x"
"size": "29x29",
"idiom": "iphone",
"filename": "Icon-App-29x29@3x.png",
"scale": "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
"size": "40x40",
"idiom": "iphone",
"filename": "Icon-App-40x40@2x.png",
"scale": "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Icon-App-40x40@3x.png",
"scale" : "3x"
"size": "40x40",
"idiom": "iphone",
"filename": "Icon-App-40x40@3x.png",
"scale": "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@2x.png",
"scale" : "2x"
"size": "60x60",
"idiom": "iphone",
"filename": "Icon-App-60x60@2x.png",
"scale": "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "Icon-App-60x60@3x.png",
"scale" : "3x"
"size": "60x60",
"idiom": "iphone",
"filename": "Icon-App-60x60@3x.png",
"scale": "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@1x.png",
"scale" : "1x"
"size": "20x20",
"idiom": "ipad",
"filename": "Icon-App-20x20@1x.png",
"scale": "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon-App-20x20@2x.png",
"scale" : "2x"
"size": "20x20",
"idiom": "ipad",
"filename": "Icon-App-20x20@2x.png",
"scale": "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@1x.png",
"scale" : "1x"
"size": "29x29",
"idiom": "ipad",
"filename": "Icon-App-29x29@1x.png",
"scale": "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon-App-29x29@2x.png",
"scale" : "2x"
"size": "29x29",
"idiom": "ipad",
"filename": "Icon-App-29x29@2x.png",
"scale": "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@1x.png",
"scale" : "1x"
"size": "40x40",
"idiom": "ipad",
"filename": "Icon-App-40x40@1x.png",
"scale": "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon-App-40x40@2x.png",
"scale" : "2x"
"size": "40x40",
"idiom": "ipad",
"filename": "Icon-App-40x40@2x.png",
"scale": "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@1x.png",
"scale" : "1x"
"size": "76x76",
"idiom": "ipad",
"filename": "Icon-App-76x76@1x.png",
"scale": "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon-App-76x76@2x.png",
"scale" : "2x"
"size": "76x76",
"idiom": "ipad",
"filename": "Icon-App-76x76@2x.png",
"scale": "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon-App-83.5x83.5@2x.png",
"scale" : "2x"
"size": "83.5x83.5",
"idiom": "ipad",
"filename": "Icon-App-83.5x83.5@2x.png",
"scale": "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon-App-1024x1024@1x.png",
"scale" : "1x"
"size": "1024x1024",
"idiom": "ios-marketing",
"filename": "Icon-App-1024x1024@1x.png",
"scale": "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"info": {
"version": 1,
"author": "xcode"
}
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"images" : [
"images": [
{
"idiom" : "universal",
"filename" : "LaunchImage.png",
"scale" : "1x"
"idiom": "universal",
"filename": "LaunchImage.png",
"scale": "1x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@2x.png",
"scale" : "2x"
"idiom": "universal",
"filename": "LaunchImage@2x.png",
"scale": "2x"
},
{
"idiom" : "universal",
"filename" : "LaunchImage@3x.png",
"scale" : "3x"
"idiom": "universal",
"filename": "LaunchImage@3x.png",
"scale": "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"info": {
"version": 1,
"author": "xcode"
}
}
96 changes: 48 additions & 48 deletions ios/Classes/FLNativeView.swift
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
import AVFoundation
import Flutter
import UIKit
import AVFoundation

// import Ultralytics

class FLNativeView: NSObject, FlutterPlatformView{
private let previewView: UIView
private let videoCapture: VideoCapture
private var busy = false

init(
frame: CGRect,
viewIdentifier viewId: Int64,
arguments args: Any?,
videoCapture: VideoCapture
) {
let screenSize: CGRect = UIScreen.main.bounds
previewView = UIView(frame: CGRect(x: 0, y: 0, width: screenSize.width, height: screenSize.height))

self.videoCapture = videoCapture

super.init()

startCameraPreview(position: .back)
}

func view() -> UIView {
return previewView
}

private func startCameraPreview(position: AVCaptureDevice.Position){
if !busy {
busy = true

videoCapture.setUp(sessionPreset: .photo, position: position) { success in
// .hd4K3840x2160 or .photo (4032x3024) Warning: 4k may not work on all devices i.e. 2019 iPod
if success {
// Add the video preview into the UI.
if let previewLayer = self.videoCapture.previewLayer {
self.previewView.layer.addSublayer(previewLayer)
self.videoCapture.previewLayer?.frame = self.previewView.bounds // resize preview layer
}

// Once everything is set up, we can start capturing live video.
self.videoCapture.start()

self.busy = false
}
}
class FLNativeView: NSObject, FlutterPlatformView {
private let previewView: UIView
private let videoCapture: VideoCapture
private var busy = false

init(
frame: CGRect,
viewIdentifier viewId: Int64,
arguments args: Any?,
videoCapture: VideoCapture
) {
let screenSize: CGRect = UIScreen.main.bounds
previewView = UIView(
frame: CGRect(x: 0, y: 0, width: screenSize.width, height: screenSize.height))

self.videoCapture = videoCapture

super.init()

startCameraPreview(position: .back)
}

func view() -> UIView {
return previewView
}

private func startCameraPreview(position: AVCaptureDevice.Position) {
if !busy {
busy = true

videoCapture.setUp(sessionPreset: .photo, position: position) { success in
// .hd4K3840x2160 or .photo (4032x3024) Warning: 4k may not work on all devices i.e. 2019 iPod
if success {
// Add the video preview into the UI.
if let previewLayer = self.videoCapture.previewLayer {
self.previewView.layer.addSublayer(previewLayer)
self.videoCapture.previewLayer?.frame = self.previewView.bounds // resize preview layer
}

// Once everything is set up, we can start capturing live video.
self.videoCapture.start()

self.busy = false
}
}
}


}
}

}
Loading
Loading