objc2_ml_compute/generated/
MLCYOLOLossDescriptor.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// The MLCYOLOLossDescriptor specifies a YOLO loss filter descriptor.
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/mlcompute/mlcyololossdescriptor?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    #[deprecated]
17    pub struct MLCYOLOLossDescriptor;
18);
19
20extern_conformance!(
21    unsafe impl NSCopying for MLCYOLOLossDescriptor {}
22);
23
24unsafe impl CopyingHelper for MLCYOLOLossDescriptor {
25    type Result = Self;
26}
27
28extern_conformance!(
29    unsafe impl NSObjectProtocol for MLCYOLOLossDescriptor {}
30);
31
32impl MLCYOLOLossDescriptor {
33    extern_methods!(
34        /// number of anchor boxes used to detect object per grid cell
35        #[deprecated]
36        #[unsafe(method(anchorBoxCount))]
37        #[unsafe(method_family = none)]
38        pub unsafe fn anchorBoxCount(&self) -> NSUInteger;
39
40        /// `NSData`containing the width and height for
41        /// `anchorBoxCount`anchor boxes
42        /// This
43        /// `NSData`should have 2 floating-point values per anchor box which represent the width
44        /// and height of the anchor box.
45        #[deprecated]
46        #[unsafe(method(anchorBoxes))]
47        #[unsafe(method_family = none)]
48        pub unsafe fn anchorBoxes(&self) -> Retained<NSData>;
49
50        /// Rescore pertains to multiplying the confidence groundTruth with IOU (intersection over union)
51        /// of predicted bounding box and the groundTruth boundingBox.  The default is YES
52        #[deprecated]
53        #[unsafe(method(shouldRescore))]
54        #[unsafe(method_family = none)]
55        pub unsafe fn shouldRescore(&self) -> bool;
56
57        /// Setter for [`shouldRescore`][Self::shouldRescore].
58        #[deprecated]
59        #[unsafe(method(setShouldRescore:))]
60        #[unsafe(method_family = none)]
61        pub unsafe fn setShouldRescore(&self, should_rescore: bool);
62
63        /// The scale factor for spatial position loss and loss gradient.  The default is 10.0
64        #[deprecated]
65        #[unsafe(method(scaleSpatialPositionLoss))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn scaleSpatialPositionLoss(&self) -> c_float;
68
69        /// Setter for [`scaleSpatialPositionLoss`][Self::scaleSpatialPositionLoss].
70        #[deprecated]
71        #[unsafe(method(setScaleSpatialPositionLoss:))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn setScaleSpatialPositionLoss(&self, scale_spatial_position_loss: c_float);
74
75        /// The scale factor for spatial size loss and loss gradient.  The default is 10.0
76        #[deprecated]
77        #[unsafe(method(scaleSpatialSizeLoss))]
78        #[unsafe(method_family = none)]
79        pub unsafe fn scaleSpatialSizeLoss(&self) -> c_float;
80
81        /// Setter for [`scaleSpatialSizeLoss`][Self::scaleSpatialSizeLoss].
82        #[deprecated]
83        #[unsafe(method(setScaleSpatialSizeLoss:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn setScaleSpatialSizeLoss(&self, scale_spatial_size_loss: c_float);
86
87        /// The scale factor for no object confidence loss and loss gradient.  The default is 5.0
88        #[deprecated]
89        #[unsafe(method(scaleNoObjectConfidenceLoss))]
90        #[unsafe(method_family = none)]
91        pub unsafe fn scaleNoObjectConfidenceLoss(&self) -> c_float;
92
93        /// Setter for [`scaleNoObjectConfidenceLoss`][Self::scaleNoObjectConfidenceLoss].
94        #[deprecated]
95        #[unsafe(method(setScaleNoObjectConfidenceLoss:))]
96        #[unsafe(method_family = none)]
97        pub unsafe fn setScaleNoObjectConfidenceLoss(
98            &self,
99            scale_no_object_confidence_loss: c_float,
100        );
101
102        /// The scale factor for object confidence loss and loss gradient.  The default is 100.0
103        #[deprecated]
104        #[unsafe(method(scaleObjectConfidenceLoss))]
105        #[unsafe(method_family = none)]
106        pub unsafe fn scaleObjectConfidenceLoss(&self) -> c_float;
107
108        /// Setter for [`scaleObjectConfidenceLoss`][Self::scaleObjectConfidenceLoss].
109        #[deprecated]
110        #[unsafe(method(setScaleObjectConfidenceLoss:))]
111        #[unsafe(method_family = none)]
112        pub unsafe fn setScaleObjectConfidenceLoss(&self, scale_object_confidence_loss: c_float);
113
114        /// The scale factor for no object classes loss and loss gradient.  The default is 2.0
115        #[deprecated]
116        #[unsafe(method(scaleClassLoss))]
117        #[unsafe(method_family = none)]
118        pub unsafe fn scaleClassLoss(&self) -> c_float;
119
120        /// Setter for [`scaleClassLoss`][Self::scaleClassLoss].
121        #[deprecated]
122        #[unsafe(method(setScaleClassLoss:))]
123        #[unsafe(method_family = none)]
124        pub unsafe fn setScaleClassLoss(&self, scale_class_loss: c_float);
125
126        /// If the prediction IOU with groundTruth is higher than this
127        /// value we consider it a confident object presence, The default is 0.7
128        #[deprecated]
129        #[unsafe(method(minimumIOUForObjectPresence))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn minimumIOUForObjectPresence(&self) -> c_float;
132
133        /// Setter for [`minimumIOUForObjectPresence`][Self::minimumIOUForObjectPresence].
134        #[deprecated]
135        #[unsafe(method(setMinimumIOUForObjectPresence:))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn setMinimumIOUForObjectPresence(
138            &self,
139            minimum_iou_for_object_presence: c_float,
140        );
141
142        /// If the prediction IOU with groundTruth is lower than this
143        /// value we consider it a confident object absence.  The default is 0.3
144        #[deprecated]
145        #[unsafe(method(maximumIOUForObjectAbsence))]
146        #[unsafe(method_family = none)]
147        pub unsafe fn maximumIOUForObjectAbsence(&self) -> c_float;
148
149        /// Setter for [`maximumIOUForObjectAbsence`][Self::maximumIOUForObjectAbsence].
150        #[deprecated]
151        #[unsafe(method(setMaximumIOUForObjectAbsence:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn setMaximumIOUForObjectAbsence(&self, maximum_iou_for_object_absence: c_float);
154
155        #[deprecated]
156        #[unsafe(method(new))]
157        #[unsafe(method_family = new)]
158        pub unsafe fn new() -> Retained<Self>;
159
160        #[deprecated]
161        #[unsafe(method(init))]
162        #[unsafe(method_family = init)]
163        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
164
165        /// Create a YOLO loss descriptor object
166        ///
167        /// Parameter `anchorBoxes`: The anchor box data
168        ///
169        /// Parameter `anchorBoxCount`: The number of anchor boxes
170        ///
171        /// Returns: A new MLCYOLOLossDescriptor object.
172        #[deprecated]
173        #[unsafe(method(descriptorWithAnchorBoxes:anchorBoxCount:))]
174        #[unsafe(method_family = none)]
175        pub unsafe fn descriptorWithAnchorBoxes_anchorBoxCount(
176            anchor_boxes: &NSData,
177            anchor_box_count: NSUInteger,
178        ) -> Retained<Self>;
179    );
180}