Skip to content

Custom arguments for Yolo-v8 model #986

Answered by GuillaumeBruand
HT0710 asked this question in Q&A
Discussion options

You must be logged in to vote

@HT0710 Custom arguments from config file are used at inference time in yolov8.

You will need a little customization for this until a PR is done, here is my implementation:

from sahi.models.yolov8 import Yolov8DetectionModel
class Yolov8CustomDetectionModel(Yolov8DetectionModel):
    def perform_inference(self, image):
        """
        Prediction is performed using self.model and the prediction result is set to self._original_predictions.
        Args:
            image: np.ndarray
                A numpy array that contains the image to be predicted. 3 channel image should be in RGB order.
        """

        # Confirm model is loaded
        if self.model is None:
            raise …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@HT0710
Comment options

@NawoyaSarah
Comment options

@filipemendesdev
Comment options

Answer selected by HT0710
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants