Skip to content

Commit

Permalink
Merge pull request #244 from grycap/dieagra_yolov8
Browse files Browse the repository at this point in the history
Dieagra yolov8
  • Loading branch information
vicente87 authored Jun 19, 2024
2 parents 6c335e5 + f69a2c8 commit 8b130e9
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 25 deletions.
25 changes: 0 additions & 25 deletions examples/README.md

This file was deleted.

19 changes: 19 additions & 0 deletions examples/plants-classification-yolov8/README.md
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 examples/plants-classification-yolov8/plants-classification.yaml
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
Binary file added examples/plants-classification-yolov8/plants.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions examples/plants-classification-yolov8/script.sh
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"



0 comments on commit 8b130e9

Please sign in to comment.