|
| 1 | +// Licensed to the .NET Foundation under one or more agreements. |
| 2 | +// The .NET Foundation licenses this file to you under the MIT license. |
| 3 | +// See the LICENSE file in the project root for more information. |
| 4 | + |
| 5 | +using System; |
| 6 | +using System.Collections.Generic; |
| 7 | +using System.Text; |
| 8 | +using Microsoft.ML.TorchSharp; |
| 9 | +using Microsoft.ML.TorchSharp.AutoFormerV2; |
| 10 | + |
| 11 | +namespace Microsoft.ML.AutoML.CodeGen |
| 12 | +{ |
| 13 | + internal partial class ObjectDetectionMulti |
| 14 | + { |
| 15 | + public override IEstimator<ITransformer> BuildFromOption(MLContext context, ObjectDetectionOption param) |
| 16 | + { |
| 17 | + var option = new ObjectDetectionTrainer.Options |
| 18 | + { |
| 19 | + LabelColumnName = param.LabelColumnName, |
| 20 | + PredictedLabelColumnName = param.PredictedLabelColumnName, |
| 21 | + BoundingBoxColumnName = param.BoundingBoxColumnName, |
| 22 | + ImageColumnName = param.ImageColumnName, |
| 23 | + ScoreColumnName = param.ScoreColumnName, |
| 24 | + MaxEpoch = param.MaxEpoch, |
| 25 | + InitLearningRate = param.InitLearningRate, |
| 26 | + WeightDecay = param.WeightDecay, |
| 27 | + PredictedBoundingBoxColumnName = param.PredictedBoundingBoxColumnName, |
| 28 | + ScoreThreshold = param.ScoreThreshold, |
| 29 | + IOUThreshold = param.IOUThreshold, |
| 30 | + }; |
| 31 | + |
| 32 | + return context.MulticlassClassification.Trainers.ObjectDetection(option); |
| 33 | + } |
| 34 | + } |
| 35 | +} |
0 commit comments