Spaces:
NSOUP
/
No application file

File size: 22,727 Bytes
ba8d952
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
import cv2
import cv2.typing
import typing


# Enumerations
VAR_NUMERICAL: int
VAR_ORDERED: int
VAR_CATEGORICAL: int
VariableTypes = int
"""One of [VAR_NUMERICAL, VAR_ORDERED, VAR_CATEGORICAL]"""

TEST_ERROR: int
TRAIN_ERROR: int
ErrorTypes = int
"""One of [TEST_ERROR, TRAIN_ERROR]"""

ROW_SAMPLE: int
COL_SAMPLE: int
SampleTypes = int
"""One of [ROW_SAMPLE, COL_SAMPLE]"""


StatModel_UPDATE_MODEL: int
STAT_MODEL_UPDATE_MODEL: int
StatModel_RAW_OUTPUT: int
STAT_MODEL_RAW_OUTPUT: int
StatModel_COMPRESSED_INPUT: int
STAT_MODEL_COMPRESSED_INPUT: int
StatModel_PREPROCESSED_INPUT: int
STAT_MODEL_PREPROCESSED_INPUT: int
StatModel_Flags = int
"""One of [StatModel_UPDATE_MODEL, STAT_MODEL_UPDATE_MODEL, StatModel_RAW_OUTPUT, STAT_MODEL_RAW_OUTPUT, StatModel_COMPRESSED_INPUT, STAT_MODEL_COMPRESSED_INPUT, StatModel_PREPROCESSED_INPUT, STAT_MODEL_PREPROCESSED_INPUT]"""

KNearest_BRUTE_FORCE: int
KNEAREST_BRUTE_FORCE: int
KNearest_KDTREE: int
KNEAREST_KDTREE: int
KNearest_Types = int
"""One of [KNearest_BRUTE_FORCE, KNEAREST_BRUTE_FORCE, KNearest_KDTREE, KNEAREST_KDTREE]"""

SVM_C_SVC: int
SVM_NU_SVC: int
SVM_ONE_CLASS: int
SVM_EPS_SVR: int
SVM_NU_SVR: int
SVM_Types = int
"""One of [SVM_C_SVC, SVM_NU_SVC, SVM_ONE_CLASS, SVM_EPS_SVR, SVM_NU_SVR]"""

SVM_CUSTOM: int
SVM_LINEAR: int
SVM_POLY: int
SVM_RBF: int
SVM_SIGMOID: int
SVM_CHI2: int
SVM_INTER: int
SVM_KernelTypes = int
"""One of [SVM_CUSTOM, SVM_LINEAR, SVM_POLY, SVM_RBF, SVM_SIGMOID, SVM_CHI2, SVM_INTER]"""

SVM_C: int
SVM_GAMMA: int
SVM_P: int
SVM_NU: int
SVM_COEF: int
SVM_DEGREE: int
SVM_ParamTypes = int
"""One of [SVM_C, SVM_GAMMA, SVM_P, SVM_NU, SVM_COEF, SVM_DEGREE]"""

EM_COV_MAT_SPHERICAL: int
EM_COV_MAT_DIAGONAL: int
EM_COV_MAT_GENERIC: int
EM_COV_MAT_DEFAULT: int
EM_Types = int
"""One of [EM_COV_MAT_SPHERICAL, EM_COV_MAT_DIAGONAL, EM_COV_MAT_GENERIC, EM_COV_MAT_DEFAULT]"""

EM_DEFAULT_NCLUSTERS: int
EM_DEFAULT_MAX_ITERS: int
EM_START_E_STEP: int
EM_START_M_STEP: int
EM_START_AUTO_STEP: int

DTrees_PREDICT_AUTO: int
DTREES_PREDICT_AUTO: int
DTrees_PREDICT_SUM: int
DTREES_PREDICT_SUM: int
DTrees_PREDICT_MAX_VOTE: int
DTREES_PREDICT_MAX_VOTE: int
DTrees_PREDICT_MASK: int
DTREES_PREDICT_MASK: int
DTrees_Flags = int
"""One of [DTrees_PREDICT_AUTO, DTREES_PREDICT_AUTO, DTrees_PREDICT_SUM, DTREES_PREDICT_SUM, DTrees_PREDICT_MAX_VOTE, DTREES_PREDICT_MAX_VOTE, DTrees_PREDICT_MASK, DTREES_PREDICT_MASK]"""

Boost_DISCRETE: int
BOOST_DISCRETE: int
Boost_REAL: int
BOOST_REAL: int
Boost_LOGIT: int
BOOST_LOGIT: int
Boost_GENTLE: int
BOOST_GENTLE: int
Boost_Types = int
"""One of [Boost_DISCRETE, BOOST_DISCRETE, Boost_REAL, BOOST_REAL, Boost_LOGIT, BOOST_LOGIT, Boost_GENTLE, BOOST_GENTLE]"""

ANN_MLP_BACKPROP: int
ANN_MLP_RPROP: int
ANN_MLP_ANNEAL: int
ANN_MLP_TrainingMethods = int
"""One of [ANN_MLP_BACKPROP, ANN_MLP_RPROP, ANN_MLP_ANNEAL]"""

ANN_MLP_IDENTITY: int
ANN_MLP_SIGMOID_SYM: int
ANN_MLP_GAUSSIAN: int
ANN_MLP_RELU: int
ANN_MLP_LEAKYRELU: int
ANN_MLP_ActivationFunctions = int
"""One of [ANN_MLP_IDENTITY, ANN_MLP_SIGMOID_SYM, ANN_MLP_GAUSSIAN, ANN_MLP_RELU, ANN_MLP_LEAKYRELU]"""

ANN_MLP_UPDATE_WEIGHTS: int
ANN_MLP_NO_INPUT_SCALE: int
ANN_MLP_NO_OUTPUT_SCALE: int
ANN_MLP_TrainFlags = int
"""One of [ANN_MLP_UPDATE_WEIGHTS, ANN_MLP_NO_INPUT_SCALE, ANN_MLP_NO_OUTPUT_SCALE]"""

LogisticRegression_REG_DISABLE: int
LOGISTIC_REGRESSION_REG_DISABLE: int
LogisticRegression_REG_L1: int
LOGISTIC_REGRESSION_REG_L1: int
LogisticRegression_REG_L2: int
LOGISTIC_REGRESSION_REG_L2: int
LogisticRegression_RegKinds = int
"""One of [LogisticRegression_REG_DISABLE, LOGISTIC_REGRESSION_REG_DISABLE, LogisticRegression_REG_L1, LOGISTIC_REGRESSION_REG_L1, LogisticRegression_REG_L2, LOGISTIC_REGRESSION_REG_L2]"""

LogisticRegression_BATCH: int
LOGISTIC_REGRESSION_BATCH: int
LogisticRegression_MINI_BATCH: int
LOGISTIC_REGRESSION_MINI_BATCH: int
LogisticRegression_Methods = int
"""One of [LogisticRegression_BATCH, LOGISTIC_REGRESSION_BATCH, LogisticRegression_MINI_BATCH, LOGISTIC_REGRESSION_MINI_BATCH]"""

SVMSGD_SGD: int
SVMSGD_ASGD: int
SVMSGD_SvmsgdType = int
"""One of [SVMSGD_SGD, SVMSGD_ASGD]"""

SVMSGD_SOFT_MARGIN: int
SVMSGD_HARD_MARGIN: int
SVMSGD_MarginType = int
"""One of [SVMSGD_SOFT_MARGIN, SVMSGD_HARD_MARGIN]"""


# Classes
class ParamGrid:
    minVal: float
    maxVal: float
    logStep: float

    # Functions
    @classmethod
    def create(cls, minVal: float = ..., maxVal: float = ..., logstep: float = ...) -> ParamGrid: ...


class TrainData:
    # Functions
    def getLayout(self) -> int: ...

    def getNTrainSamples(self) -> int: ...

    def getNTestSamples(self) -> int: ...

    def getNSamples(self) -> int: ...

    def getNVars(self) -> int: ...

    def getNAllVars(self) -> int: ...

    @typing.overload
    def getSample(self, varIdx: cv2.typing.MatLike, sidx: int, buf: float) -> None: ...
    @typing.overload
    def getSample(self, varIdx: cv2.UMat, sidx: int, buf: float) -> None: ...

    def getSamples(self) -> cv2.typing.MatLike: ...

    def getMissing(self) -> cv2.typing.MatLike: ...

    def getTrainSamples(self, layout: int = ..., compressSamples: bool = ..., compressVars: bool = ...) -> cv2.typing.MatLike: ...

    def getTrainResponses(self) -> cv2.typing.MatLike: ...

    def getTrainNormCatResponses(self) -> cv2.typing.MatLike: ...

    def getTestResponses(self) -> cv2.typing.MatLike: ...

    def getTestNormCatResponses(self) -> cv2.typing.MatLike: ...

    def getResponses(self) -> cv2.typing.MatLike: ...

    def getNormCatResponses(self) -> cv2.typing.MatLike: ...

    def getSampleWeights(self) -> cv2.typing.MatLike: ...

    def getTrainSampleWeights(self) -> cv2.typing.MatLike: ...

    def getTestSampleWeights(self) -> cv2.typing.MatLike: ...

    def getVarIdx(self) -> cv2.typing.MatLike: ...

    def getVarType(self) -> cv2.typing.MatLike: ...

    def getVarSymbolFlags(self) -> cv2.typing.MatLike: ...

    def getResponseType(self) -> int: ...

    def getTrainSampleIdx(self) -> cv2.typing.MatLike: ...

    def getTestSampleIdx(self) -> cv2.typing.MatLike: ...

    @typing.overload
    def getValues(self, vi: int, sidx: cv2.typing.MatLike, values: float) -> None: ...
    @typing.overload
    def getValues(self, vi: int, sidx: cv2.UMat, values: float) -> None: ...

    def getDefaultSubstValues(self) -> cv2.typing.MatLike: ...

    def getCatCount(self, vi: int) -> int: ...

    def getClassLabels(self) -> cv2.typing.MatLike: ...

    def getCatOfs(self) -> cv2.typing.MatLike: ...

    def getCatMap(self) -> cv2.typing.MatLike: ...

    def setTrainTestSplit(self, count: int, shuffle: bool = ...) -> None: ...

    def setTrainTestSplitRatio(self, ratio: float, shuffle: bool = ...) -> None: ...

    def shuffleTrainTest(self) -> None: ...

    def getTestSamples(self) -> cv2.typing.MatLike: ...

    def getNames(self, names: typing.Sequence[str]) -> None: ...

    @staticmethod
    def getSubVector(vec: cv2.typing.MatLike, idx: cv2.typing.MatLike) -> cv2.typing.MatLike: ...

    @staticmethod
    def getSubMatrix(matrix: cv2.typing.MatLike, idx: cv2.typing.MatLike, layout: int) -> cv2.typing.MatLike: ...

    @classmethod
    @typing.overload
    def create(cls, samples: cv2.typing.MatLike, layout: int, responses: cv2.typing.MatLike, varIdx: cv2.typing.MatLike | None = ..., sampleIdx: cv2.typing.MatLike | None = ..., sampleWeights: cv2.typing.MatLike | None = ..., varType: cv2.typing.MatLike | None = ...) -> TrainData: ...
    @classmethod
    @typing.overload
    def create(cls, samples: cv2.UMat, layout: int, responses: cv2.UMat, varIdx: cv2.UMat | None = ..., sampleIdx: cv2.UMat | None = ..., sampleWeights: cv2.UMat | None = ..., varType: cv2.UMat | None = ...) -> TrainData: ...


class StatModel(cv2.Algorithm):
    # Functions
    def getVarCount(self) -> int: ...

    def empty(self) -> bool: ...

    def isTrained(self) -> bool: ...

    def isClassifier(self) -> bool: ...

    @typing.overload
    def train(self, trainData: TrainData, flags: int = ...) -> bool: ...
    @typing.overload
    def train(self, samples: cv2.typing.MatLike, layout: int, responses: cv2.typing.MatLike) -> bool: ...
    @typing.overload
    def train(self, samples: cv2.UMat, layout: int, responses: cv2.UMat) -> bool: ...

    @typing.overload
    def calcError(self, data: TrainData, test: bool, resp: cv2.typing.MatLike | None = ...) -> tuple[float, cv2.typing.MatLike]: ...
    @typing.overload
    def calcError(self, data: TrainData, test: bool, resp: cv2.UMat | None = ...) -> tuple[float, cv2.UMat]: ...

    @typing.overload
    def predict(self, samples: cv2.typing.MatLike, results: cv2.typing.MatLike | None = ..., flags: int = ...) -> tuple[float, cv2.typing.MatLike]: ...
    @typing.overload
    def predict(self, samples: cv2.UMat, results: cv2.UMat | None = ..., flags: int = ...) -> tuple[float, cv2.UMat]: ...


class NormalBayesClassifier(StatModel):
    # Functions
    @typing.overload
    def predictProb(self, inputs: cv2.typing.MatLike, outputs: cv2.typing.MatLike | None = ..., outputProbs: cv2.typing.MatLike | None = ..., flags: int = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike]: ...
    @typing.overload
    def predictProb(self, inputs: cv2.UMat, outputs: cv2.UMat | None = ..., outputProbs: cv2.UMat | None = ..., flags: int = ...) -> tuple[float, cv2.UMat, cv2.UMat]: ...

    @classmethod
    def create(cls) -> NormalBayesClassifier: ...

    @classmethod
    def load(cls, filepath: str, nodeName: str = ...) -> NormalBayesClassifier: ...


class KNearest(StatModel):
    # Functions
    def getDefaultK(self) -> int: ...

    def setDefaultK(self, val: int) -> None: ...

    def getIsClassifier(self) -> bool: ...

    def setIsClassifier(self, val: bool) -> None: ...

    def getEmax(self) -> int: ...

    def setEmax(self, val: int) -> None: ...

    def getAlgorithmType(self) -> int: ...

    def setAlgorithmType(self, val: int) -> None: ...

    @typing.overload
    def findNearest(self, samples: cv2.typing.MatLike, k: int, results: cv2.typing.MatLike | None = ..., neighborResponses: cv2.typing.MatLike | None = ..., dist: cv2.typing.MatLike | None = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
    @typing.overload
    def findNearest(self, samples: cv2.UMat, k: int, results: cv2.UMat | None = ..., neighborResponses: cv2.UMat | None = ..., dist: cv2.UMat | None = ...) -> tuple[float, cv2.UMat, cv2.UMat, cv2.UMat]: ...

    @classmethod
    def create(cls) -> KNearest: ...

    @classmethod
    def load(cls, filepath: str) -> KNearest: ...


class SVM(StatModel):
    # Functions
    def getType(self) -> int: ...

    def setType(self, val: int) -> None: ...

    def getGamma(self) -> float: ...

    def setGamma(self, val: float) -> None: ...

    def getCoef0(self) -> float: ...

    def setCoef0(self, val: float) -> None: ...

    def getDegree(self) -> float: ...

    def setDegree(self, val: float) -> None: ...

    def getC(self) -> float: ...

    def setC(self, val: float) -> None: ...

    def getNu(self) -> float: ...

    def setNu(self, val: float) -> None: ...

    def getP(self) -> float: ...

    def setP(self, val: float) -> None: ...

    def getClassWeights(self) -> cv2.typing.MatLike: ...

    def setClassWeights(self, val: cv2.typing.MatLike) -> None: ...

    def getTermCriteria(self) -> cv2.typing.TermCriteria: ...

    def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ...

    def getKernelType(self) -> int: ...

    def setKernel(self, kernelType: int) -> None: ...

    @typing.overload
    def trainAuto(self, samples: cv2.typing.MatLike, layout: int, responses: cv2.typing.MatLike, kFold: int = ..., Cgrid: ParamGrid = ..., gammaGrid: ParamGrid = ..., pGrid: ParamGrid = ..., nuGrid: ParamGrid = ..., coeffGrid: ParamGrid = ..., degreeGrid: ParamGrid = ..., balanced: bool = ...) -> bool: ...
    @typing.overload
    def trainAuto(self, samples: cv2.UMat, layout: int, responses: cv2.UMat, kFold: int = ..., Cgrid: ParamGrid = ..., gammaGrid: ParamGrid = ..., pGrid: ParamGrid = ..., nuGrid: ParamGrid = ..., coeffGrid: ParamGrid = ..., degreeGrid: ParamGrid = ..., balanced: bool = ...) -> bool: ...

    def getSupportVectors(self) -> cv2.typing.MatLike: ...

    def getUncompressedSupportVectors(self) -> cv2.typing.MatLike: ...

    @typing.overload
    def getDecisionFunction(self, i: int, alpha: cv2.typing.MatLike | None = ..., svidx: cv2.typing.MatLike | None = ...) -> tuple[float, cv2.typing.MatLike, cv2.typing.MatLike]: ...
    @typing.overload
    def getDecisionFunction(self, i: int, alpha: cv2.UMat | None = ..., svidx: cv2.UMat | None = ...) -> tuple[float, cv2.UMat, cv2.UMat]: ...

    @staticmethod
    def getDefaultGridPtr(param_id: int) -> ParamGrid: ...

    @classmethod
    def create(cls) -> SVM: ...

    @classmethod
    def load(cls, filepath: str) -> SVM: ...


class EM(StatModel):
    # Functions
    def getClustersNumber(self) -> int: ...

    def setClustersNumber(self, val: int) -> None: ...

    def getCovarianceMatrixType(self) -> int: ...

    def setCovarianceMatrixType(self, val: int) -> None: ...

    def getTermCriteria(self) -> cv2.typing.TermCriteria: ...

    def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ...

    def getWeights(self) -> cv2.typing.MatLike: ...

    def getMeans(self) -> cv2.typing.MatLike: ...

    def getCovs(self, covs: typing.Sequence[cv2.typing.MatLike] | None = ...) -> typing.Sequence[cv2.typing.MatLike]: ...

    @typing.overload
    def predict(self, samples: cv2.typing.MatLike, results: cv2.typing.MatLike | None = ..., flags: int = ...) -> tuple[float, cv2.typing.MatLike]: ...
    @typing.overload
    def predict(self, samples: cv2.UMat, results: cv2.UMat | None = ..., flags: int = ...) -> tuple[float, cv2.UMat]: ...

    @typing.overload
    def predict2(self, sample: cv2.typing.MatLike, probs: cv2.typing.MatLike | None = ...) -> tuple[cv2.typing.Vec2d, cv2.typing.MatLike]: ...
    @typing.overload
    def predict2(self, sample: cv2.UMat, probs: cv2.UMat | None = ...) -> tuple[cv2.typing.Vec2d, cv2.UMat]: ...

    @typing.overload
    def trainEM(self, samples: cv2.typing.MatLike, logLikelihoods: cv2.typing.MatLike | None = ..., labels: cv2.typing.MatLike | None = ..., probs: cv2.typing.MatLike | None = ...) -> tuple[bool, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
    @typing.overload
    def trainEM(self, samples: cv2.UMat, logLikelihoods: cv2.UMat | None = ..., labels: cv2.UMat | None = ..., probs: cv2.UMat | None = ...) -> tuple[bool, cv2.UMat, cv2.UMat, cv2.UMat]: ...

    @typing.overload
    def trainE(self, samples: cv2.typing.MatLike, means0: cv2.typing.MatLike, covs0: cv2.typing.MatLike | None = ..., weights0: cv2.typing.MatLike | None = ..., logLikelihoods: cv2.typing.MatLike | None = ..., labels: cv2.typing.MatLike | None = ..., probs: cv2.typing.MatLike | None = ...) -> tuple[bool, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
    @typing.overload
    def trainE(self, samples: cv2.UMat, means0: cv2.UMat, covs0: cv2.UMat | None = ..., weights0: cv2.UMat | None = ..., logLikelihoods: cv2.UMat | None = ..., labels: cv2.UMat | None = ..., probs: cv2.UMat | None = ...) -> tuple[bool, cv2.UMat, cv2.UMat, cv2.UMat]: ...

    @typing.overload
    def trainM(self, samples: cv2.typing.MatLike, probs0: cv2.typing.MatLike, logLikelihoods: cv2.typing.MatLike | None = ..., labels: cv2.typing.MatLike | None = ..., probs: cv2.typing.MatLike | None = ...) -> tuple[bool, cv2.typing.MatLike, cv2.typing.MatLike, cv2.typing.MatLike]: ...
    @typing.overload
    def trainM(self, samples: cv2.UMat, probs0: cv2.UMat, logLikelihoods: cv2.UMat | None = ..., labels: cv2.UMat | None = ..., probs: cv2.UMat | None = ...) -> tuple[bool, cv2.UMat, cv2.UMat, cv2.UMat]: ...

    @classmethod
    def create(cls) -> EM: ...

    @classmethod
    def load(cls, filepath: str, nodeName: str = ...) -> EM: ...


class DTrees(StatModel):
    # Functions
    def getMaxCategories(self) -> int: ...

    def setMaxCategories(self, val: int) -> None: ...

    def getMaxDepth(self) -> int: ...

    def setMaxDepth(self, val: int) -> None: ...

    def getMinSampleCount(self) -> int: ...

    def setMinSampleCount(self, val: int) -> None: ...

    def getCVFolds(self) -> int: ...

    def setCVFolds(self, val: int) -> None: ...

    def getUseSurrogates(self) -> bool: ...

    def setUseSurrogates(self, val: bool) -> None: ...

    def getUse1SERule(self) -> bool: ...

    def setUse1SERule(self, val: bool) -> None: ...

    def getTruncatePrunedTree(self) -> bool: ...

    def setTruncatePrunedTree(self, val: bool) -> None: ...

    def getRegressionAccuracy(self) -> float: ...

    def setRegressionAccuracy(self, val: float) -> None: ...

    def getPriors(self) -> cv2.typing.MatLike: ...

    def setPriors(self, val: cv2.typing.MatLike) -> None: ...

    @classmethod
    def create(cls) -> DTrees: ...

    @classmethod
    def load(cls, filepath: str, nodeName: str = ...) -> DTrees: ...


class ANN_MLP(StatModel):
    # Functions
    def setTrainMethod(self, method: int, param1: float = ..., param2: float = ...) -> None: ...

    def getTrainMethod(self) -> int: ...

    def setActivationFunction(self, type: int, param1: float = ..., param2: float = ...) -> None: ...

    @typing.overload
    def setLayerSizes(self, _layer_sizes: cv2.typing.MatLike) -> None: ...
    @typing.overload
    def setLayerSizes(self, _layer_sizes: cv2.UMat) -> None: ...

    def getLayerSizes(self) -> cv2.typing.MatLike: ...

    def getTermCriteria(self) -> cv2.typing.TermCriteria: ...

    def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ...

    def getBackpropWeightScale(self) -> float: ...

    def setBackpropWeightScale(self, val: float) -> None: ...

    def getBackpropMomentumScale(self) -> float: ...

    def setBackpropMomentumScale(self, val: float) -> None: ...

    def getRpropDW0(self) -> float: ...

    def setRpropDW0(self, val: float) -> None: ...

    def getRpropDWPlus(self) -> float: ...

    def setRpropDWPlus(self, val: float) -> None: ...

    def getRpropDWMinus(self) -> float: ...

    def setRpropDWMinus(self, val: float) -> None: ...

    def getRpropDWMin(self) -> float: ...

    def setRpropDWMin(self, val: float) -> None: ...

    def getRpropDWMax(self) -> float: ...

    def setRpropDWMax(self, val: float) -> None: ...

    def getAnnealInitialT(self) -> float: ...

    def setAnnealInitialT(self, val: float) -> None: ...

    def getAnnealFinalT(self) -> float: ...

    def setAnnealFinalT(self, val: float) -> None: ...

    def getAnnealCoolingRatio(self) -> float: ...

    def setAnnealCoolingRatio(self, val: float) -> None: ...

    def getAnnealItePerStep(self) -> int: ...

    def setAnnealItePerStep(self, val: int) -> None: ...

    def getWeights(self, layerIdx: int) -> cv2.typing.MatLike: ...

    @classmethod
    def create(cls) -> ANN_MLP: ...

    @classmethod
    def load(cls, filepath: str) -> ANN_MLP: ...


class LogisticRegression(StatModel):
    # Functions
    def getLearningRate(self) -> float: ...

    def setLearningRate(self, val: float) -> None: ...

    def getIterations(self) -> int: ...

    def setIterations(self, val: int) -> None: ...

    def getRegularization(self) -> int: ...

    def setRegularization(self, val: int) -> None: ...

    def getTrainMethod(self) -> int: ...

    def setTrainMethod(self, val: int) -> None: ...

    def getMiniBatchSize(self) -> int: ...

    def setMiniBatchSize(self, val: int) -> None: ...

    def getTermCriteria(self) -> cv2.typing.TermCriteria: ...

    def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ...

    @typing.overload
    def predict(self, samples: cv2.typing.MatLike, results: cv2.typing.MatLike | None = ..., flags: int = ...) -> tuple[float, cv2.typing.MatLike]: ...
    @typing.overload
    def predict(self, samples: cv2.UMat, results: cv2.UMat | None = ..., flags: int = ...) -> tuple[float, cv2.UMat]: ...

    def get_learnt_thetas(self) -> cv2.typing.MatLike: ...

    @classmethod
    def create(cls) -> LogisticRegression: ...

    @classmethod
    def load(cls, filepath: str, nodeName: str = ...) -> LogisticRegression: ...


class SVMSGD(StatModel):
    # Functions
    def getWeights(self) -> cv2.typing.MatLike: ...

    def getShift(self) -> float: ...

    @classmethod
    def create(cls) -> SVMSGD: ...

    @classmethod
    def load(cls, filepath: str, nodeName: str = ...) -> SVMSGD: ...

    def setOptimalParameters(self, svmsgdType: int = ..., marginType: int = ...) -> None: ...

    def getSvmsgdType(self) -> int: ...

    def setSvmsgdType(self, svmsgdType: int) -> None: ...

    def getMarginType(self) -> int: ...

    def setMarginType(self, marginType: int) -> None: ...

    def getMarginRegularization(self) -> float: ...

    def setMarginRegularization(self, marginRegularization: float) -> None: ...

    def getInitialStepSize(self) -> float: ...

    def setInitialStepSize(self, InitialStepSize: float) -> None: ...

    def getStepDecreasingPower(self) -> float: ...

    def setStepDecreasingPower(self, stepDecreasingPower: float) -> None: ...

    def getTermCriteria(self) -> cv2.typing.TermCriteria: ...

    def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ...


class RTrees(DTrees):
    # Functions
    def getCalculateVarImportance(self) -> bool: ...

    def setCalculateVarImportance(self, val: bool) -> None: ...

    def getActiveVarCount(self) -> int: ...

    def setActiveVarCount(self, val: int) -> None: ...

    def getTermCriteria(self) -> cv2.typing.TermCriteria: ...

    def setTermCriteria(self, val: cv2.typing.TermCriteria) -> None: ...

    def getVarImportance(self) -> cv2.typing.MatLike: ...

    @typing.overload
    def getVotes(self, samples: cv2.typing.MatLike, flags: int, results: cv2.typing.MatLike | None = ...) -> cv2.typing.MatLike: ...
    @typing.overload
    def getVotes(self, samples: cv2.UMat, flags: int, results: cv2.UMat | None = ...) -> cv2.UMat: ...

    def getOOBError(self) -> float: ...

    @classmethod
    def create(cls) -> RTrees: ...

    @classmethod
    def load(cls, filepath: str, nodeName: str = ...) -> RTrees: ...


class Boost(DTrees):
    # Functions
    def getBoostType(self) -> int: ...

    def setBoostType(self, val: int) -> None: ...

    def getWeakCount(self) -> int: ...

    def setWeakCount(self, val: int) -> None: ...

    def getWeightTrimRate(self) -> float: ...

    def setWeightTrimRate(self, val: float) -> None: ...

    @classmethod
    def create(cls) -> Boost: ...

    @classmethod
    def load(cls, filepath: str, nodeName: str = ...) -> Boost: ...