public async Task <Document> PredictOptionsFieldsAsync(string id)
        {
            var documento = _documentosRepository.ObterDocumento(id);

            if (documento.CropedOptionsFields?.Count > 0)
            {
                foreach (var key in documento.CropedOptionsFields.Keys)
                {
                    var    cropId = documento.CropedOptionsFields[key];
                    string path   = CreateLocalFile(ObjectId.Parse(cropId));

                    _logger.LogWarning($"Croped boxes {key} loaded!");

                    var result = this.Predict(new MLModels.ModelInput
                    {
                        ImageSource = path
                    }, "OptionsField");

                    UpdateOptionField(documento, key, result.Prediction);
                }
            }

            return(await _documentosRepository.AtualizarDocumentoAsync(documento));
        }
예제 #2
0
 public async Task <Document> AtualizarDocumentoAsync(Document documento)
 {
     return(await _documentosRepository.AtualizarDocumentoAsync(documento));
 }