Skip to content

Commit

Permalink
Added YOLOv8 example in English and other related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dialdroid committed Oct 21, 2024
1 parent 1ceba8f commit bcf766b
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/yolov8/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Object Detection with YOLOv8

Detect objects in images using the state-of-the-art YOLOv8 model.

## About YOLO

This node utilizes the YOLOv8 (You Only Look Once version 8) model to detect objects within images. YOLOv8 is a cutting-edge, real-time object detection system known for its speed and accuracy, capable of identifying thousands of object categories efficiently.

## About YOLOV8 Service in OSCAR

This service uses the pre-trained YOLOv8 model provided by DEEP-Hybrid-DataCloud for object detection. It is designed to handle synchronous invocations and real-time image processing with high scalability, managed automatically by an elastic Kubernetes cluster.

In order to invoke the function, first you have to create a service, either by the OSCAR UI or by using the FDL within the following command.


``` sh
oscar-cli apply yolov8.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 yolov8.yaml minio img/cat.jpg yolov8/input/cat.jpg
Binary file added examples/yolov8/img/cat.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions examples/yolov8/img/cat.jpg:Zone.Identifier
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[ZoneTransfer]
ZoneId=3
ReferrerUrl=https://www.google.com/
HostUrl=https://upload.wikimedia.org/wikipedia/commons/thumb/4/4d/Cat_November_2010-1a.jpg/220px-Cat_November_2010-1a.jpg
8 changes: 8 additions & 0 deletions examples/yolov8/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

IMAGE_NAME=`basename "$INPUT_FILE_PATH"`
OUTPUT_FILE="$TMP_OUTPUT_DIR/output.png"

deepaas-cli --deepaas_method_output="$OUTPUT_FILE" predict --files "$INPUT_FILE_PATH" --accept image/png 2>&1

echo "Prediction was saved in: $OUTPUT_FILE"
17 changes: 17 additions & 0 deletions examples/yolov8/yolov8.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
functions:
oscar:
- oscar-cluster:
name: yolov8
memory: 4Gi
cpu: '2.0'
image: ai4oshub/ai4os-yolov8-torch:latest
script: script.sh
vo: vo.imagine-ai.eu
allowed_users: []
log_level: CRITICAL
input:
- storage_provider: minio.default
path: yolov8/input
output:
- storage_provider: minio.default
path: yolov8/output

0 comments on commit bcf766b

Please sign in to comment.