objc2-ml-compute 0.3.2

Bindings to the MLCompute framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// The MLCYOLOLossDescriptor specifies a YOLO loss filter descriptor.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcyololossdescriptor?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    #[deprecated]
    pub struct MLCYOLOLossDescriptor;
);

extern_conformance!(
    unsafe impl NSCopying for MLCYOLOLossDescriptor {}
);

unsafe impl CopyingHelper for MLCYOLOLossDescriptor {
    type Result = Self;
}

extern_conformance!(
    unsafe impl NSObjectProtocol for MLCYOLOLossDescriptor {}
);

impl MLCYOLOLossDescriptor {
    extern_methods!(
        /// number of anchor boxes used to detect object per grid cell
        #[deprecated]
        #[unsafe(method(anchorBoxCount))]
        #[unsafe(method_family = none)]
        pub unsafe fn anchorBoxCount(&self) -> NSUInteger;

        /// `NSData`containing the width and height for
        /// `anchorBoxCount`anchor boxes
        /// This
        /// `NSData`should have 2 floating-point values per anchor box which represent the width
        /// and height of the anchor box.
        #[deprecated]
        #[unsafe(method(anchorBoxes))]
        #[unsafe(method_family = none)]
        pub unsafe fn anchorBoxes(&self) -> Retained<NSData>;

        /// Rescore pertains to multiplying the confidence groundTruth with IOU (intersection over union)
        /// of predicted bounding box and the groundTruth boundingBox.  The default is YES
        #[deprecated]
        #[unsafe(method(shouldRescore))]
        #[unsafe(method_family = none)]
        pub unsafe fn shouldRescore(&self) -> bool;

        /// Setter for [`shouldRescore`][Self::shouldRescore].
        #[deprecated]
        #[unsafe(method(setShouldRescore:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setShouldRescore(&self, should_rescore: bool);

        /// The scale factor for spatial position loss and loss gradient.  The default is 10.0
        #[deprecated]
        #[unsafe(method(scaleSpatialPositionLoss))]
        #[unsafe(method_family = none)]
        pub unsafe fn scaleSpatialPositionLoss(&self) -> c_float;

        /// Setter for [`scaleSpatialPositionLoss`][Self::scaleSpatialPositionLoss].
        #[deprecated]
        #[unsafe(method(setScaleSpatialPositionLoss:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setScaleSpatialPositionLoss(&self, scale_spatial_position_loss: c_float);

        /// The scale factor for spatial size loss and loss gradient.  The default is 10.0
        #[deprecated]
        #[unsafe(method(scaleSpatialSizeLoss))]
        #[unsafe(method_family = none)]
        pub unsafe fn scaleSpatialSizeLoss(&self) -> c_float;

        /// Setter for [`scaleSpatialSizeLoss`][Self::scaleSpatialSizeLoss].
        #[deprecated]
        #[unsafe(method(setScaleSpatialSizeLoss:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setScaleSpatialSizeLoss(&self, scale_spatial_size_loss: c_float);

        /// The scale factor for no object confidence loss and loss gradient.  The default is 5.0
        #[deprecated]
        #[unsafe(method(scaleNoObjectConfidenceLoss))]
        #[unsafe(method_family = none)]
        pub unsafe fn scaleNoObjectConfidenceLoss(&self) -> c_float;

        /// Setter for [`scaleNoObjectConfidenceLoss`][Self::scaleNoObjectConfidenceLoss].
        #[deprecated]
        #[unsafe(method(setScaleNoObjectConfidenceLoss:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setScaleNoObjectConfidenceLoss(
            &self,
            scale_no_object_confidence_loss: c_float,
        );

        /// The scale factor for object confidence loss and loss gradient.  The default is 100.0
        #[deprecated]
        #[unsafe(method(scaleObjectConfidenceLoss))]
        #[unsafe(method_family = none)]
        pub unsafe fn scaleObjectConfidenceLoss(&self) -> c_float;

        /// Setter for [`scaleObjectConfidenceLoss`][Self::scaleObjectConfidenceLoss].
        #[deprecated]
        #[unsafe(method(setScaleObjectConfidenceLoss:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setScaleObjectConfidenceLoss(&self, scale_object_confidence_loss: c_float);

        /// The scale factor for no object classes loss and loss gradient.  The default is 2.0
        #[deprecated]
        #[unsafe(method(scaleClassLoss))]
        #[unsafe(method_family = none)]
        pub unsafe fn scaleClassLoss(&self) -> c_float;

        /// Setter for [`scaleClassLoss`][Self::scaleClassLoss].
        #[deprecated]
        #[unsafe(method(setScaleClassLoss:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setScaleClassLoss(&self, scale_class_loss: c_float);

        /// If the prediction IOU with groundTruth is higher than this
        /// value we consider it a confident object presence, The default is 0.7
        #[deprecated]
        #[unsafe(method(minimumIOUForObjectPresence))]
        #[unsafe(method_family = none)]
        pub unsafe fn minimumIOUForObjectPresence(&self) -> c_float;

        /// Setter for [`minimumIOUForObjectPresence`][Self::minimumIOUForObjectPresence].
        #[deprecated]
        #[unsafe(method(setMinimumIOUForObjectPresence:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMinimumIOUForObjectPresence(
            &self,
            minimum_iou_for_object_presence: c_float,
        );

        /// If the prediction IOU with groundTruth is lower than this
        /// value we consider it a confident object absence.  The default is 0.3
        #[deprecated]
        #[unsafe(method(maximumIOUForObjectAbsence))]
        #[unsafe(method_family = none)]
        pub unsafe fn maximumIOUForObjectAbsence(&self) -> c_float;

        /// Setter for [`maximumIOUForObjectAbsence`][Self::maximumIOUForObjectAbsence].
        #[deprecated]
        #[unsafe(method(setMaximumIOUForObjectAbsence:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setMaximumIOUForObjectAbsence(&self, maximum_iou_for_object_absence: c_float);

        #[deprecated]
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;

        #[deprecated]
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        /// Create a YOLO loss descriptor object
        ///
        /// Parameter `anchorBoxes`: The anchor box data
        ///
        /// Parameter `anchorBoxCount`: The number of anchor boxes
        ///
        /// Returns: A new MLCYOLOLossDescriptor object.
        #[deprecated]
        #[unsafe(method(descriptorWithAnchorBoxes:anchorBoxCount:))]
        #[unsafe(method_family = none)]
        pub unsafe fn descriptorWithAnchorBoxes_anchorBoxCount(
            anchor_boxes: &NSData,
            anchor_box_count: NSUInteger,
        ) -> Retained<Self>;
    );
}