-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from tucan9389/param-ui
[PR] Add some control UI components for parameters of post-process
- Loading branch information
Showing
14 changed files
with
1,329 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,028 changes: 921 additions & 107 deletions
1,028
PoseEstimation-TFLiteSwift/Base.lproj/Main.storyboard
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// NumericExtension.swift | ||
// PoseEstimation-TFLiteSwift | ||
// | ||
// Created by Doyoung Gwak on 2020/05/03. | ||
// Copyright © 2020 Doyoung Gwak. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
extension Optional where Wrapped == Float { | ||
var labelString: String { | ||
guard let value = self else { return "nil" } | ||
return String(format: "%.2f", value) | ||
} | ||
} | ||
|
||
extension Float32 { | ||
func string(_ format: String = "%.2f") -> String { | ||
return String(format: format, self) | ||
} | ||
} | ||
|
||
extension Optional where Wrapped == Float { | ||
static func *(lhs: Wrapped?, rhs: Float) -> Self { | ||
guard let lhs = lhs else { return nil } | ||
return some(lhs * rhs) | ||
} | ||
} | ||
|
||
extension Int { | ||
var labelString: String { | ||
return String(format: "%d", self) | ||
} | ||
} | ||
|
||
extension Optional where Wrapped == Int { | ||
var labelString: String { | ||
guard let value = self else { return "nil" } | ||
return value.labelString | ||
} | ||
} |
Oops, something went wrong.