-
Notifications
You must be signed in to change notification settings - Fork 15
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 #244 from grycap/dieagra_yolov8
Dieagra yolov8
- Loading branch information
Showing
5 changed files
with
45 additions
and
25 deletions.
There are no files selected for viewing
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Plants classification yolov8 | ||
|
||
This example uses the pre-trained classification model by DEEP-Hybrid-DataCloud | ||
[Plants species classifier](https://dashboard.cloud.ai4eosc.eu/marketplace/modules/plants-classification) | ||
and is prepared to be used with asynchronous invocations. | ||
|
||
|
||
In order to invoke the function, first you have to do is create a service, | ||
either by the OSCAR UI or by using the FDL within the following command. | ||
|
||
``` sh | ||
oscar-cli apply plants-classification.yaml | ||
``` | ||
|
||
Once the service is created you can make the invocation with the following | ||
command, which will store the output on a minio bucket. | ||
|
||
``` sh | ||
oscar-cli service put-file plants-classification.yaml minio images/plants.jpg plants-classification/input/plants.jpg |
15 changes: 15 additions & 0 deletions
15
examples/plants-classification-yolov8/plants-classification.yaml
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,15 @@ | ||
functions: | ||
oscar: | ||
- oscar-cluster: | ||
name: plants-classification | ||
memory: 2Gi | ||
cpu: '1.0' | ||
image: ai4oshub/plants-classification | ||
script: script.sh | ||
log_level: CRITICAL | ||
input: | ||
- storage_provider: minio.default | ||
path: plants-classification/input | ||
output: | ||
- storage_provider: minio.default | ||
path: plants-classification/output |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
IMAGE_NAME=`basename "$INPUT_FILE_PATH"` | ||
OUTPUT_FILE="$TMP_OUTPUT_DIR/output.json" | ||
|
||
deepaas-cli predict --files "$INPUT_FILE_PATH" 2>&1 | grep -Po '{.*}' > "$OUTPUT_FILE" | ||
|
||
echo "Prediction was saved in: $OUTPUT_FILE" | ||
|
||
|
||
|