1 package training
2
3
4
5
6
7
8
9 import (
10 "encoding/json"
11 "github.com/Azure/go-autorest/autorest"
12 "github.com/Azure/go-autorest/autorest/date"
13 "github.com/gofrs/uuid"
14 )
15
16
17 const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/customvision/training"
18
19
20 type Bool struct {
21 autorest.Response `json:"-"`
22 Value *bool `json:"value,omitempty"`
23 }
24
25
26 type BoundingBox struct {
27
28 Left *float64 `json:"left,omitempty"`
29
30 Top *float64 `json:"top,omitempty"`
31
32 Width *float64 `json:"width,omitempty"`
33
34 Height *float64 `json:"height,omitempty"`
35 }
36
37
38 type CustomVisionError struct {
39
40 Code CustomVisionErrorCodes `json:"code,omitempty"`
41
42 Message *string `json:"message,omitempty"`
43 }
44
45
46 type Domain struct {
47 autorest.Response `json:"-"`
48
49 ID *uuid.UUID `json:"id,omitempty"`
50
51 Name *string `json:"name,omitempty"`
52
53 Type DomainType `json:"type,omitempty"`
54
55 Exportable *bool `json:"exportable,omitempty"`
56
57 Enabled *bool `json:"enabled,omitempty"`
58 }
59
60
61 func (d Domain) MarshalJSON() ([]byte, error) {
62 objectMap := make(map[string]interface{})
63 return json.Marshal(objectMap)
64 }
65
66
67 type Export struct {
68 autorest.Response `json:"-"`
69
70 Platform ExportPlatform `json:"platform,omitempty"`
71
72 Status ExportStatus `json:"status,omitempty"`
73
74 DownloadURI *string `json:"downloadUri,omitempty"`
75
76 Flavor ExportFlavor `json:"flavor,omitempty"`
77
78 NewerVersionAvailable *bool `json:"newerVersionAvailable,omitempty"`
79 }
80
81
82 func (e Export) MarshalJSON() ([]byte, error) {
83 objectMap := make(map[string]interface{})
84 return json.Marshal(objectMap)
85 }
86
87
88 type Image struct {
89
90 ID *uuid.UUID `json:"id,omitempty"`
91
92 Created *date.Time `json:"created,omitempty"`
93
94 Width *int32 `json:"width,omitempty"`
95
96 Height *int32 `json:"height,omitempty"`
97
98 ResizedImageURI *string `json:"resizedImageUri,omitempty"`
99
100 ThumbnailURI *string `json:"thumbnailUri,omitempty"`
101
102 OriginalImageURI *string `json:"originalImageUri,omitempty"`
103
104 Tags *[]ImageTag `json:"tags,omitempty"`
105
106 Regions *[]ImageRegion `json:"regions,omitempty"`
107 }
108
109
110 func (i Image) MarshalJSON() ([]byte, error) {
111 objectMap := make(map[string]interface{})
112 return json.Marshal(objectMap)
113 }
114
115
116 type ImageCreateResult struct {
117
118 SourceURL *string `json:"sourceUrl,omitempty"`
119
120 Status ImageCreateStatus `json:"status,omitempty"`
121
122 Image *Image `json:"image,omitempty"`
123 }
124
125
126 func (icr ImageCreateResult) MarshalJSON() ([]byte, error) {
127 objectMap := make(map[string]interface{})
128 return json.Marshal(objectMap)
129 }
130
131
132 type ImageCreateSummary struct {
133 autorest.Response `json:"-"`
134
135 IsBatchSuccessful *bool `json:"isBatchSuccessful,omitempty"`
136
137 Images *[]ImageCreateResult `json:"images,omitempty"`
138 }
139
140
141 func (ics ImageCreateSummary) MarshalJSON() ([]byte, error) {
142 objectMap := make(map[string]interface{})
143 return json.Marshal(objectMap)
144 }
145
146
147 type ImageFileCreateBatch struct {
148 Images *[]ImageFileCreateEntry `json:"images,omitempty"`
149 TagIds *[]uuid.UUID `json:"tagIds,omitempty"`
150 }
151
152
153 type ImageFileCreateEntry struct {
154 Name *string `json:"name,omitempty"`
155 Contents *[]byte `json:"contents,omitempty"`
156 TagIds *[]uuid.UUID `json:"tagIds,omitempty"`
157 Regions *[]Region `json:"regions,omitempty"`
158 }
159
160
161 type ImageIDCreateBatch struct {
162 Images *[]ImageIDCreateEntry `json:"images,omitempty"`
163 TagIds *[]uuid.UUID `json:"tagIds,omitempty"`
164 }
165
166
167 type ImageIDCreateEntry struct {
168
169 ID *uuid.UUID `json:"id,omitempty"`
170 TagIds *[]uuid.UUID `json:"tagIds,omitempty"`
171 Regions *[]Region `json:"regions,omitempty"`
172 }
173
174
175 type ImagePerformance struct {
176
177 Predictions *[]Prediction `json:"predictions,omitempty"`
178
179 ID *uuid.UUID `json:"id,omitempty"`
180
181 Created *date.Time `json:"created,omitempty"`
182
183 Width *int32 `json:"width,omitempty"`
184
185 Height *int32 `json:"height,omitempty"`
186
187 ImageURI *string `json:"imageUri,omitempty"`
188
189 ThumbnailURI *string `json:"thumbnailUri,omitempty"`
190
191 Tags *[]ImageTag `json:"tags,omitempty"`
192
193 Regions *[]ImageRegion `json:"regions,omitempty"`
194 }
195
196
197 func (IP ImagePerformance) MarshalJSON() ([]byte, error) {
198 objectMap := make(map[string]interface{})
199 return json.Marshal(objectMap)
200 }
201
202
203 type ImagePrediction struct {
204 autorest.Response `json:"-"`
205
206 ID *uuid.UUID `json:"id,omitempty"`
207
208 Project *uuid.UUID `json:"project,omitempty"`
209
210 Iteration *uuid.UUID `json:"iteration,omitempty"`
211
212 Created *date.Time `json:"created,omitempty"`
213
214 Predictions *[]Prediction `json:"predictions,omitempty"`
215 }
216
217
218 func (IP ImagePrediction) MarshalJSON() ([]byte, error) {
219 objectMap := make(map[string]interface{})
220 return json.Marshal(objectMap)
221 }
222
223
224 type ImageRegion struct {
225
226 RegionID *uuid.UUID `json:"regionId,omitempty"`
227
228 TagName *string `json:"tagName,omitempty"`
229
230 Created *date.Time `json:"created,omitempty"`
231
232 TagID *uuid.UUID `json:"tagId,omitempty"`
233
234 Left *float64 `json:"left,omitempty"`
235
236 Top *float64 `json:"top,omitempty"`
237
238 Width *float64 `json:"width,omitempty"`
239
240 Height *float64 `json:"height,omitempty"`
241 }
242
243
244 func (ir ImageRegion) MarshalJSON() ([]byte, error) {
245 objectMap := make(map[string]interface{})
246 if ir.TagID != nil {
247 objectMap["tagId"] = ir.TagID
248 }
249 if ir.Left != nil {
250 objectMap["left"] = ir.Left
251 }
252 if ir.Top != nil {
253 objectMap["top"] = ir.Top
254 }
255 if ir.Width != nil {
256 objectMap["width"] = ir.Width
257 }
258 if ir.Height != nil {
259 objectMap["height"] = ir.Height
260 }
261 return json.Marshal(objectMap)
262 }
263
264
265 type ImageRegionCreateBatch struct {
266 Regions *[]ImageRegionCreateEntry `json:"regions,omitempty"`
267 }
268
269
270 type ImageRegionCreateEntry struct {
271
272 ImageID *uuid.UUID `json:"imageId,omitempty"`
273
274 TagID *uuid.UUID `json:"tagId,omitempty"`
275
276 Left *float64 `json:"left,omitempty"`
277
278 Top *float64 `json:"top,omitempty"`
279
280 Width *float64 `json:"width,omitempty"`
281
282 Height *float64 `json:"height,omitempty"`
283 }
284
285
286 type ImageRegionCreateResult struct {
287
288 ImageID *uuid.UUID `json:"imageId,omitempty"`
289
290 RegionID *uuid.UUID `json:"regionId,omitempty"`
291
292 TagName *string `json:"tagName,omitempty"`
293
294 Created *date.Time `json:"created,omitempty"`
295
296 TagID *uuid.UUID `json:"tagId,omitempty"`
297
298 Left *float64 `json:"left,omitempty"`
299
300 Top *float64 `json:"top,omitempty"`
301
302 Width *float64 `json:"width,omitempty"`
303
304 Height *float64 `json:"height,omitempty"`
305 }
306
307
308 func (ircr ImageRegionCreateResult) MarshalJSON() ([]byte, error) {
309 objectMap := make(map[string]interface{})
310 if ircr.TagID != nil {
311 objectMap["tagId"] = ircr.TagID
312 }
313 if ircr.Left != nil {
314 objectMap["left"] = ircr.Left
315 }
316 if ircr.Top != nil {
317 objectMap["top"] = ircr.Top
318 }
319 if ircr.Width != nil {
320 objectMap["width"] = ircr.Width
321 }
322 if ircr.Height != nil {
323 objectMap["height"] = ircr.Height
324 }
325 return json.Marshal(objectMap)
326 }
327
328
329 type ImageRegionCreateSummary struct {
330 autorest.Response `json:"-"`
331 Created *[]ImageRegionCreateResult `json:"created,omitempty"`
332 Duplicated *[]ImageRegionCreateEntry `json:"duplicated,omitempty"`
333 Exceeded *[]ImageRegionCreateEntry `json:"exceeded,omitempty"`
334 }
335
336
337 type ImageRegionProposal struct {
338 autorest.Response `json:"-"`
339
340 ProjectID *uuid.UUID `json:"projectId,omitempty"`
341
342 ImageID *uuid.UUID `json:"imageId,omitempty"`
343
344 Proposals *[]RegionProposal `json:"proposals,omitempty"`
345 }
346
347
348 func (irp ImageRegionProposal) MarshalJSON() ([]byte, error) {
349 objectMap := make(map[string]interface{})
350 return json.Marshal(objectMap)
351 }
352
353
354 type ImageTag struct {
355
356 TagID *uuid.UUID `json:"tagId,omitempty"`
357
358 TagName *string `json:"tagName,omitempty"`
359
360 Created *date.Time `json:"created,omitempty"`
361 }
362
363
364 func (it ImageTag) MarshalJSON() ([]byte, error) {
365 objectMap := make(map[string]interface{})
366 return json.Marshal(objectMap)
367 }
368
369
370 type ImageTagCreateBatch struct {
371
372 Tags *[]ImageTagCreateEntry `json:"tags,omitempty"`
373 }
374
375
376 type ImageTagCreateEntry struct {
377
378 ImageID *uuid.UUID `json:"imageId,omitempty"`
379
380 TagID *uuid.UUID `json:"tagId,omitempty"`
381 }
382
383
384 type ImageTagCreateSummary struct {
385 autorest.Response `json:"-"`
386 Created *[]ImageTagCreateEntry `json:"created,omitempty"`
387 Duplicated *[]ImageTagCreateEntry `json:"duplicated,omitempty"`
388 Exceeded *[]ImageTagCreateEntry `json:"exceeded,omitempty"`
389 }
390
391
392 type ImageURL struct {
393
394 URL *string `json:"url,omitempty"`
395 }
396
397
398 type ImageURLCreateBatch struct {
399 Images *[]ImageURLCreateEntry `json:"images,omitempty"`
400 TagIds *[]uuid.UUID `json:"tagIds,omitempty"`
401 }
402
403
404 type ImageURLCreateEntry struct {
405
406 URL *string `json:"url,omitempty"`
407 TagIds *[]uuid.UUID `json:"tagIds,omitempty"`
408 Regions *[]Region `json:"regions,omitempty"`
409 }
410
411
412 type Int32 struct {
413 autorest.Response `json:"-"`
414 Value *int32 `json:"value,omitempty"`
415 }
416
417
418 type Iteration struct {
419 autorest.Response `json:"-"`
420
421 ID *uuid.UUID `json:"id,omitempty"`
422
423 Name *string `json:"name,omitempty"`
424
425 Status *string `json:"status,omitempty"`
426
427 Created *date.Time `json:"created,omitempty"`
428
429 LastModified *date.Time `json:"lastModified,omitempty"`
430
431 TrainedAt *date.Time `json:"trainedAt,omitempty"`
432
433 ProjectID *uuid.UUID `json:"projectId,omitempty"`
434
435 Exportable *bool `json:"exportable,omitempty"`
436
437 ExportableTo *[]string `json:"exportableTo,omitempty"`
438
439 DomainID *uuid.UUID `json:"domainId,omitempty"`
440
441 ClassificationType Classifier `json:"classificationType,omitempty"`
442
443 TrainingType Type `json:"trainingType,omitempty"`
444
445 ReservedBudgetInHours *int32 `json:"reservedBudgetInHours,omitempty"`
446
447 PublishName *string `json:"publishName,omitempty"`
448
449 OriginalPublishResourceID *string `json:"originalPublishResourceId,omitempty"`
450 }
451
452
453 func (i Iteration) MarshalJSON() ([]byte, error) {
454 objectMap := make(map[string]interface{})
455 if i.Name != nil {
456 objectMap["name"] = i.Name
457 }
458 return json.Marshal(objectMap)
459 }
460
461
462 type IterationPerformance struct {
463 autorest.Response `json:"-"`
464
465 PerTagPerformance *[]TagPerformance `json:"perTagPerformance,omitempty"`
466
467 Precision *float64 `json:"precision,omitempty"`
468
469 PrecisionStdDeviation *float64 `json:"precisionStdDeviation,omitempty"`
470
471 Recall *float64 `json:"recall,omitempty"`
472
473 RecallStdDeviation *float64 `json:"recallStdDeviation,omitempty"`
474
475 AveragePrecision *float64 `json:"averagePrecision,omitempty"`
476 }
477
478
479 func (IP IterationPerformance) MarshalJSON() ([]byte, error) {
480 objectMap := make(map[string]interface{})
481 return json.Marshal(objectMap)
482 }
483
484
485 type ListDomain struct {
486 autorest.Response `json:"-"`
487 Value *[]Domain `json:"value,omitempty"`
488 }
489
490
491 type ListExport struct {
492 autorest.Response `json:"-"`
493 Value *[]Export `json:"value,omitempty"`
494 }
495
496
497 type ListImage struct {
498 autorest.Response `json:"-"`
499 Value *[]Image `json:"value,omitempty"`
500 }
501
502
503 type ListImagePerformance struct {
504 autorest.Response `json:"-"`
505 Value *[]ImagePerformance `json:"value,omitempty"`
506 }
507
508
509 type ListIteration struct {
510 autorest.Response `json:"-"`
511 Value *[]Iteration `json:"value,omitempty"`
512 }
513
514
515 type ListProject struct {
516 autorest.Response `json:"-"`
517 Value *[]Project `json:"value,omitempty"`
518 }
519
520
521 type ListTag struct {
522 autorest.Response `json:"-"`
523 Value *[]Tag `json:"value,omitempty"`
524 }
525
526
527 type Prediction struct {
528
529 Probability *float64 `json:"probability,omitempty"`
530
531 TagID *uuid.UUID `json:"tagId,omitempty"`
532
533 TagName *string `json:"tagName,omitempty"`
534
535 BoundingBox *BoundingBox `json:"boundingBox,omitempty"`
536 }
537
538
539 func (p Prediction) MarshalJSON() ([]byte, error) {
540 objectMap := make(map[string]interface{})
541 return json.Marshal(objectMap)
542 }
543
544
545 type PredictionQueryResult struct {
546 autorest.Response `json:"-"`
547
548 Token *PredictionQueryToken `json:"token,omitempty"`
549
550 Results *[]StoredImagePrediction `json:"results,omitempty"`
551 }
552
553
554 func (pqr PredictionQueryResult) MarshalJSON() ([]byte, error) {
555 objectMap := make(map[string]interface{})
556 return json.Marshal(objectMap)
557 }
558
559
560 type PredictionQueryTag struct {
561
562 ID *uuid.UUID `json:"id,omitempty"`
563
564 MinThreshold *float64 `json:"minThreshold,omitempty"`
565
566 MaxThreshold *float64 `json:"maxThreshold,omitempty"`
567 }
568
569
570 func (pqt PredictionQueryTag) MarshalJSON() ([]byte, error) {
571 objectMap := make(map[string]interface{})
572 return json.Marshal(objectMap)
573 }
574
575
576 type PredictionQueryToken struct {
577 Session *string `json:"session,omitempty"`
578 Continuation *string `json:"continuation,omitempty"`
579 MaxCount *int32 `json:"maxCount,omitempty"`
580
581 OrderBy OrderBy `json:"orderBy,omitempty"`
582 Tags *[]PredictionQueryTag `json:"tags,omitempty"`
583 IterationID *uuid.UUID `json:"iterationId,omitempty"`
584 StartTime *date.Time `json:"startTime,omitempty"`
585 EndTime *date.Time `json:"endTime,omitempty"`
586 Application *string `json:"application,omitempty"`
587 }
588
589
590 type Project struct {
591 autorest.Response `json:"-"`
592
593 ID *uuid.UUID `json:"id,omitempty"`
594
595 Name *string `json:"name,omitempty"`
596
597 Description *string `json:"description,omitempty"`
598
599 Settings *ProjectSettings `json:"settings,omitempty"`
600
601 Created *date.Time `json:"created,omitempty"`
602
603 LastModified *date.Time `json:"lastModified,omitempty"`
604
605 ThumbnailURI *string `json:"thumbnailUri,omitempty"`
606
607 DrModeEnabled *bool `json:"drModeEnabled,omitempty"`
608 }
609
610
611 func (p Project) MarshalJSON() ([]byte, error) {
612 objectMap := make(map[string]interface{})
613 if p.Name != nil {
614 objectMap["name"] = p.Name
615 }
616 if p.Description != nil {
617 objectMap["description"] = p.Description
618 }
619 if p.Settings != nil {
620 objectMap["settings"] = p.Settings
621 }
622 return json.Marshal(objectMap)
623 }
624
625
626 type ProjectSettings struct {
627
628 DomainID *uuid.UUID `json:"domainId,omitempty"`
629
630 ClassificationType Classifier `json:"classificationType,omitempty"`
631
632 TargetExportPlatforms *[]string `json:"targetExportPlatforms,omitempty"`
633 }
634
635
636 type Region struct {
637
638 TagID *uuid.UUID `json:"tagId,omitempty"`
639
640 Left *float64 `json:"left,omitempty"`
641
642 Top *float64 `json:"top,omitempty"`
643
644 Width *float64 `json:"width,omitempty"`
645
646 Height *float64 `json:"height,omitempty"`
647 }
648
649
650 type RegionProposal struct {
651
652 Confidence *float64 `json:"confidence,omitempty"`
653
654 BoundingBox *BoundingBox `json:"boundingBox,omitempty"`
655 }
656
657
658 func (rp RegionProposal) MarshalJSON() ([]byte, error) {
659 objectMap := make(map[string]interface{})
660 return json.Marshal(objectMap)
661 }
662
663
664 type StoredImagePrediction struct {
665
666 ResizedImageURI *string `json:"resizedImageUri,omitempty"`
667
668 ThumbnailURI *string `json:"thumbnailUri,omitempty"`
669
670 OriginalImageURI *string `json:"originalImageUri,omitempty"`
671
672 Domain *uuid.UUID `json:"domain,omitempty"`
673
674 ID *uuid.UUID `json:"id,omitempty"`
675
676 Project *uuid.UUID `json:"project,omitempty"`
677
678 Iteration *uuid.UUID `json:"iteration,omitempty"`
679
680 Created *date.Time `json:"created,omitempty"`
681
682 Predictions *[]Prediction `json:"predictions,omitempty"`
683 }
684
685
686 func (sip StoredImagePrediction) MarshalJSON() ([]byte, error) {
687 objectMap := make(map[string]interface{})
688 return json.Marshal(objectMap)
689 }
690
691
692 type Tag struct {
693 autorest.Response `json:"-"`
694
695 ID *uuid.UUID `json:"id,omitempty"`
696
697 Name *string `json:"name,omitempty"`
698
699 Description *string `json:"description,omitempty"`
700
701 Type TagType `json:"type,omitempty"`
702
703 ImageCount *int32 `json:"imageCount,omitempty"`
704 }
705
706
707 func (t Tag) MarshalJSON() ([]byte, error) {
708 objectMap := make(map[string]interface{})
709 if t.Name != nil {
710 objectMap["name"] = t.Name
711 }
712 if t.Description != nil {
713 objectMap["description"] = t.Description
714 }
715 if t.Type != "" {
716 objectMap["type"] = t.Type
717 }
718 return json.Marshal(objectMap)
719 }
720
721
722 type TagPerformance struct {
723
724 ID *uuid.UUID `json:"id,omitempty"`
725
726 Name *string `json:"name,omitempty"`
727
728 Precision *float64 `json:"precision,omitempty"`
729
730 PrecisionStdDeviation *float64 `json:"precisionStdDeviation,omitempty"`
731
732 Recall *float64 `json:"recall,omitempty"`
733
734 RecallStdDeviation *float64 `json:"recallStdDeviation,omitempty"`
735
736 AveragePrecision *float64 `json:"averagePrecision,omitempty"`
737 }
738
739
740 func (tp TagPerformance) MarshalJSON() ([]byte, error) {
741 objectMap := make(map[string]interface{})
742 return json.Marshal(objectMap)
743 }
744
View as plain text