-
Notifications
You must be signed in to change notification settings - Fork 3
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 #65 from Yoonit-Labs/feature/computer-vision
Computer Vision models usage
- Loading branch information
Showing
12 changed files
with
107 additions
and
83 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
52 changes: 52 additions & 0 deletions
52
yoonit-camera/src/main/java/ai/cyberlabs/yoonit/camera/ComputerVision.kt
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,52 @@ | ||
package ai.cyberlabs.yoonit.camera | ||
|
||
import ai.cyberlabs.yoonit.camera.models.CaptureOptions | ||
import android.util.Size | ||
import java.io.File | ||
|
||
class ComputerVision { | ||
|
||
/** | ||
* Enable/disable computer vision usage. | ||
* Default value is `false`. | ||
*/ | ||
var enable: Boolean = CaptureOptions.ComputerVision.enable | ||
set(value) { | ||
CaptureOptions.ComputerVision.enable = value | ||
field = value | ||
} | ||
|
||
/** | ||
* The computer vision model paths. | ||
* Default value is an empty array. | ||
*/ | ||
var modelPaths: ArrayList<String> = CaptureOptions.ComputerVision.paths | ||
set(value) { | ||
value.forEach { | ||
modelPath -> | ||
if (!File(modelPath).exists()) { | ||
throw IllegalArgumentException("${KeyError.INVALID_COMPUTER_VISION_MODEL_PATHS}: $modelPath") | ||
} | ||
} | ||
|
||
CaptureOptions.ComputerVision.paths = value | ||
field = value | ||
} | ||
|
||
/** | ||
* Image input size to use the loaded model paths. | ||
* Default value is (0, 0). | ||
*/ | ||
var inputSize: Size = CaptureOptions.ComputerVision.inputSize | ||
set(value) { | ||
CaptureOptions.ComputerVision.inputSize = value | ||
field = value | ||
} | ||
|
||
/** | ||
* Clear computer vision path models. | ||
*/ | ||
fun clear() { | ||
CaptureOptions.ComputerVision.clear() | ||
} | ||
} |
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
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
Oops, something went wrong.