1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
//! 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>;
);
}