Exemple #1
0
 internal ImageObjectDetection(LogVerbosity?logVerbosity, TaskType taskType, ObjectDetectionPrimaryMetrics?primaryMetric, ImageModelSettingsObjectDetection modelSettings, IList <ImageModelDistributionSettingsObjectDetection> searchSpace, ImageVerticalDataSettings dataSettings, ImageLimitSettings limitSettings, ImageSweepSettings sweepSettings) : base(logVerbosity, taskType)
 {
     PrimaryMetric = primaryMetric;
     ModelSettings = modelSettings;
     SearchSpace   = searchSpace;
     DataSettings  = dataSettings;
     LimitSettings = limitSettings;
     SweepSettings = sweepSettings;
     TaskType      = taskType;
 }
Exemple #2
0
 internal ImageClassificationMultilabel(LogVerbosity?logVerbosity, TaskType taskType, ClassificationMultilabelPrimaryMetrics?primaryMetric, ImageModelSettingsClassification modelSettings, IList <ImageModelDistributionSettingsClassification> searchSpace, ImageVerticalDataSettings dataSettings, ImageLimitSettings limitSettings, ImageSweepSettings sweepSettings) : base(logVerbosity, taskType)
 {
     PrimaryMetric = primaryMetric;
     ModelSettings = modelSettings;
     SearchSpace   = searchSpace;
     DataSettings  = dataSettings;
     LimitSettings = limitSettings;
     SweepSettings = sweepSettings;
     TaskType      = taskType;
 }
Exemple #3
0
        public ImageObjectDetection(ImageVerticalDataSettings dataSettings, ImageLimitSettings limitSettings)
        {
            if (dataSettings == null)
            {
                throw new ArgumentNullException(nameof(dataSettings));
            }
            if (limitSettings == null)
            {
                throw new ArgumentNullException(nameof(limitSettings));
            }

            SearchSpace   = new ChangeTrackingList <ImageModelDistributionSettingsObjectDetection>();
            DataSettings  = dataSettings;
            LimitSettings = limitSettings;
            TaskType      = TaskType.ImageObjectDetection;
        }
Exemple #4
0
        internal static ImageObjectDetection DeserializeImageObjectDetection(JsonElement element)
        {
            Optional <ObjectDetectionPrimaryMetrics>     primaryMetric = default;
            Optional <ImageModelSettingsObjectDetection> modelSettings = default;
            Optional <IList <ImageModelDistributionSettingsObjectDetection> > searchSpace = default;
            ImageVerticalDataSettings     dataSettings  = default;
            ImageLimitSettings            limitSettings = default;
            Optional <ImageSweepSettings> sweepSettings = default;
            Optional <LogVerbosity>       logVerbosity  = default;
            TaskType taskType = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("primaryMetric"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    primaryMetric = new ObjectDetectionPrimaryMetrics(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("modelSettings"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        modelSettings = null;
                        continue;
                    }
                    modelSettings = ImageModelSettingsObjectDetection.DeserializeImageModelSettingsObjectDetection(property.Value);
                    continue;
                }
                if (property.NameEquals("searchSpace"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        searchSpace = null;
                        continue;
                    }
                    List <ImageModelDistributionSettingsObjectDetection> array = new List <ImageModelDistributionSettingsObjectDetection>();
                    foreach (var item in property.Value.EnumerateArray())
                    {
                        array.Add(ImageModelDistributionSettingsObjectDetection.DeserializeImageModelDistributionSettingsObjectDetection(item));
                    }
                    searchSpace = array;
                    continue;
                }
                if (property.NameEquals("dataSettings"))
                {
                    dataSettings = ImageVerticalDataSettings.DeserializeImageVerticalDataSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("limitSettings"))
                {
                    limitSettings = ImageLimitSettings.DeserializeImageLimitSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("sweepSettings"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        sweepSettings = null;
                        continue;
                    }
                    sweepSettings = ImageSweepSettings.DeserializeImageSweepSettings(property.Value);
                    continue;
                }
                if (property.NameEquals("logVerbosity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    logVerbosity = new LogVerbosity(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("taskType"))
                {
                    taskType = new TaskType(property.Value.GetString());
                    continue;
                }
            }
            return(new ImageObjectDetection(Optional.ToNullable(logVerbosity), taskType, Optional.ToNullable(primaryMetric), modelSettings.Value, Optional.ToList(searchSpace), dataSettings, limitSettings, sweepSettings.Value));
        }