Update objectdet.
This commit is contained in:
449
objectdet/src/ObjectdetClient.cc
Normal file
449
objectdet/src/ObjectdetClient.cc
Normal file
@@ -0,0 +1,449 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/ObjectdetClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Objectdet;
|
||||
using namespace AlibabaCloud::Objectdet::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "objectdet";
|
||||
}
|
||||
|
||||
ObjectdetClient::ObjectdetClient(const Credentials &credentials, const ClientConfiguration &configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(credentials), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentials, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "objectdet");
|
||||
}
|
||||
|
||||
ObjectdetClient::ObjectdetClient(const std::shared_ptr<CredentialsProvider>& credentialsProvider, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, credentialsProvider, configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(credentialsProvider, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "objectdet");
|
||||
}
|
||||
|
||||
ObjectdetClient::ObjectdetClient(const std::string & accessKeyId, const std::string & accessKeySecret, const ClientConfiguration & configuration) :
|
||||
RpcServiceClient(SERVICE_NAME, std::make_shared<SimpleCredentialsProvider>(accessKeyId, accessKeySecret), configuration)
|
||||
{
|
||||
auto locationClient = std::make_shared<LocationClient>(accessKeyId, accessKeySecret, configuration);
|
||||
endpointProvider_ = std::make_shared<EndpointProvider>(locationClient, configuration.regionId(), SERVICE_NAME, "objectdet");
|
||||
}
|
||||
|
||||
ObjectdetClient::~ObjectdetClient()
|
||||
{}
|
||||
|
||||
ObjectdetClient::ClassifyVehicleInsuranceOutcome ObjectdetClient::classifyVehicleInsurance(const ClassifyVehicleInsuranceRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ClassifyVehicleInsuranceOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ClassifyVehicleInsuranceOutcome(ClassifyVehicleInsuranceResult(outcome.result()));
|
||||
else
|
||||
return ClassifyVehicleInsuranceOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ObjectdetClient::classifyVehicleInsuranceAsync(const ClassifyVehicleInsuranceRequest& request, const ClassifyVehicleInsuranceAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, classifyVehicleInsurance(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ObjectdetClient::ClassifyVehicleInsuranceOutcomeCallable ObjectdetClient::classifyVehicleInsuranceCallable(const ClassifyVehicleInsuranceRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ClassifyVehicleInsuranceOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->classifyVehicleInsurance(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ObjectdetClient::DetectMainBodyOutcome ObjectdetClient::detectMainBody(const DetectMainBodyRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DetectMainBodyOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DetectMainBodyOutcome(DetectMainBodyResult(outcome.result()));
|
||||
else
|
||||
return DetectMainBodyOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ObjectdetClient::detectMainBodyAsync(const DetectMainBodyRequest& request, const DetectMainBodyAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, detectMainBody(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ObjectdetClient::DetectMainBodyOutcomeCallable ObjectdetClient::detectMainBodyCallable(const DetectMainBodyRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DetectMainBodyOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->detectMainBody(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ObjectdetClient::DetectObjectOutcome ObjectdetClient::detectObject(const DetectObjectRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DetectObjectOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DetectObjectOutcome(DetectObjectResult(outcome.result()));
|
||||
else
|
||||
return DetectObjectOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ObjectdetClient::detectObjectAsync(const DetectObjectRequest& request, const DetectObjectAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, detectObject(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ObjectdetClient::DetectObjectOutcomeCallable ObjectdetClient::detectObjectCallable(const DetectObjectRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DetectObjectOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->detectObject(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ObjectdetClient::DetectTransparentImageOutcome ObjectdetClient::detectTransparentImage(const DetectTransparentImageRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DetectTransparentImageOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DetectTransparentImageOutcome(DetectTransparentImageResult(outcome.result()));
|
||||
else
|
||||
return DetectTransparentImageOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ObjectdetClient::detectTransparentImageAsync(const DetectTransparentImageRequest& request, const DetectTransparentImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, detectTransparentImage(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ObjectdetClient::DetectTransparentImageOutcomeCallable ObjectdetClient::detectTransparentImageCallable(const DetectTransparentImageRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DetectTransparentImageOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->detectTransparentImage(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ObjectdetClient::DetectVehicleOutcome ObjectdetClient::detectVehicle(const DetectVehicleRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DetectVehicleOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DetectVehicleOutcome(DetectVehicleResult(outcome.result()));
|
||||
else
|
||||
return DetectVehicleOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ObjectdetClient::detectVehicleAsync(const DetectVehicleRequest& request, const DetectVehicleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, detectVehicle(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ObjectdetClient::DetectVehicleOutcomeCallable ObjectdetClient::detectVehicleCallable(const DetectVehicleRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DetectVehicleOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->detectVehicle(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ObjectdetClient::DetectWhiteBaseImageOutcome ObjectdetClient::detectWhiteBaseImage(const DetectWhiteBaseImageRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DetectWhiteBaseImageOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DetectWhiteBaseImageOutcome(DetectWhiteBaseImageResult(outcome.result()));
|
||||
else
|
||||
return DetectWhiteBaseImageOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ObjectdetClient::detectWhiteBaseImageAsync(const DetectWhiteBaseImageRequest& request, const DetectWhiteBaseImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, detectWhiteBaseImage(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ObjectdetClient::DetectWhiteBaseImageOutcomeCallable ObjectdetClient::detectWhiteBaseImageCallable(const DetectWhiteBaseImageRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DetectWhiteBaseImageOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->detectWhiteBaseImage(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ObjectdetClient::GenerateVehicleRepairPlanOutcome ObjectdetClient::generateVehicleRepairPlan(const GenerateVehicleRepairPlanRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GenerateVehicleRepairPlanOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GenerateVehicleRepairPlanOutcome(GenerateVehicleRepairPlanResult(outcome.result()));
|
||||
else
|
||||
return GenerateVehicleRepairPlanOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ObjectdetClient::generateVehicleRepairPlanAsync(const GenerateVehicleRepairPlanRequest& request, const GenerateVehicleRepairPlanAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, generateVehicleRepairPlan(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ObjectdetClient::GenerateVehicleRepairPlanOutcomeCallable ObjectdetClient::generateVehicleRepairPlanCallable(const GenerateVehicleRepairPlanRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GenerateVehicleRepairPlanOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->generateVehicleRepairPlan(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ObjectdetClient::GetVehicleRepairPlanOutcome ObjectdetClient::getVehicleRepairPlan(const GetVehicleRepairPlanRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return GetVehicleRepairPlanOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return GetVehicleRepairPlanOutcome(GetVehicleRepairPlanResult(outcome.result()));
|
||||
else
|
||||
return GetVehicleRepairPlanOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ObjectdetClient::getVehicleRepairPlanAsync(const GetVehicleRepairPlanRequest& request, const GetVehicleRepairPlanAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, getVehicleRepairPlan(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ObjectdetClient::GetVehicleRepairPlanOutcomeCallable ObjectdetClient::getVehicleRepairPlanCallable(const GetVehicleRepairPlanRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<GetVehicleRepairPlanOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->getVehicleRepairPlan(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ObjectdetClient::RecognizeVehicleDamageOutcome ObjectdetClient::recognizeVehicleDamage(const RecognizeVehicleDamageRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeVehicleDamageOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeVehicleDamageOutcome(RecognizeVehicleDamageResult(outcome.result()));
|
||||
else
|
||||
return RecognizeVehicleDamageOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ObjectdetClient::recognizeVehicleDamageAsync(const RecognizeVehicleDamageRequest& request, const RecognizeVehicleDamageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeVehicleDamage(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ObjectdetClient::RecognizeVehicleDamageOutcomeCallable ObjectdetClient::recognizeVehicleDamageCallable(const RecognizeVehicleDamageRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeVehicleDamageOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeVehicleDamage(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ObjectdetClient::RecognizeVehicleDashboardOutcome ObjectdetClient::recognizeVehicleDashboard(const RecognizeVehicleDashboardRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeVehicleDashboardOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeVehicleDashboardOutcome(RecognizeVehicleDashboardResult(outcome.result()));
|
||||
else
|
||||
return RecognizeVehicleDashboardOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ObjectdetClient::recognizeVehicleDashboardAsync(const RecognizeVehicleDashboardRequest& request, const RecognizeVehicleDashboardAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeVehicleDashboard(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ObjectdetClient::RecognizeVehicleDashboardOutcomeCallable ObjectdetClient::recognizeVehicleDashboardCallable(const RecognizeVehicleDashboardRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeVehicleDashboardOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeVehicleDashboard(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ObjectdetClient::RecognizeVehiclePartsOutcome ObjectdetClient::recognizeVehicleParts(const RecognizeVehiclePartsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeVehiclePartsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeVehiclePartsOutcome(RecognizeVehiclePartsResult(outcome.result()));
|
||||
else
|
||||
return RecognizeVehiclePartsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ObjectdetClient::recognizeVehiclePartsAsync(const RecognizeVehiclePartsRequest& request, const RecognizeVehiclePartsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeVehicleParts(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ObjectdetClient::RecognizeVehiclePartsOutcomeCallable ObjectdetClient::recognizeVehiclePartsCallable(const RecognizeVehiclePartsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeVehiclePartsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeVehicleParts(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
40
objectdet/src/model/ClassifyVehicleInsuranceRequest.cc
Normal file
40
objectdet/src/model/ClassifyVehicleInsuranceRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/ClassifyVehicleInsuranceRequest.h>
|
||||
|
||||
using AlibabaCloud::Objectdet::Model::ClassifyVehicleInsuranceRequest;
|
||||
|
||||
ClassifyVehicleInsuranceRequest::ClassifyVehicleInsuranceRequest() :
|
||||
RpcServiceRequest("objectdet", "2019-12-30", "ClassifyVehicleInsurance")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ClassifyVehicleInsuranceRequest::~ClassifyVehicleInsuranceRequest()
|
||||
{}
|
||||
|
||||
std::string ClassifyVehicleInsuranceRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void ClassifyVehicleInsuranceRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
62
objectdet/src/model/ClassifyVehicleInsuranceResult.cc
Normal file
62
objectdet/src/model/ClassifyVehicleInsuranceResult.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/ClassifyVehicleInsuranceResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Objectdet;
|
||||
using namespace AlibabaCloud::Objectdet::Model;
|
||||
|
||||
ClassifyVehicleInsuranceResult::ClassifyVehicleInsuranceResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ClassifyVehicleInsuranceResult::ClassifyVehicleInsuranceResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ClassifyVehicleInsuranceResult::~ClassifyVehicleInsuranceResult()
|
||||
{}
|
||||
|
||||
void ClassifyVehicleInsuranceResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Threshold"].isNull())
|
||||
data_.threshold = std::stof(dataNode["Threshold"].asString());
|
||||
auto allLabelsNode = dataNode["Labels"]["Label"];
|
||||
for (auto dataNodeLabelsLabel : allLabelsNode)
|
||||
{
|
||||
Data::Label labelObject;
|
||||
if(!dataNodeLabelsLabel["Score"].isNull())
|
||||
labelObject.score = std::stof(dataNodeLabelsLabel["Score"].asString());
|
||||
if(!dataNodeLabelsLabel["Name"].isNull())
|
||||
labelObject.name = dataNodeLabelsLabel["Name"].asString();
|
||||
data_.labels.push_back(labelObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ClassifyVehicleInsuranceResult::Data ClassifyVehicleInsuranceResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
objectdet/src/model/DetectMainBodyRequest.cc
Normal file
40
objectdet/src/model/DetectMainBodyRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/DetectMainBodyRequest.h>
|
||||
|
||||
using AlibabaCloud::Objectdet::Model::DetectMainBodyRequest;
|
||||
|
||||
DetectMainBodyRequest::DetectMainBodyRequest() :
|
||||
RpcServiceRequest("objectdet", "2019-12-30", "DetectMainBody")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DetectMainBodyRequest::~DetectMainBodyRequest()
|
||||
{}
|
||||
|
||||
std::string DetectMainBodyRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void DetectMainBodyRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
59
objectdet/src/model/DetectMainBodyResult.cc
Normal file
59
objectdet/src/model/DetectMainBodyResult.cc
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/DetectMainBodyResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Objectdet;
|
||||
using namespace AlibabaCloud::Objectdet::Model;
|
||||
|
||||
DetectMainBodyResult::DetectMainBodyResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DetectMainBodyResult::DetectMainBodyResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DetectMainBodyResult::~DetectMainBodyResult()
|
||||
{}
|
||||
|
||||
void DetectMainBodyResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto locationNode = dataNode["Location"];
|
||||
if(!locationNode["X"].isNull())
|
||||
data_.location.x = std::stoi(locationNode["X"].asString());
|
||||
if(!locationNode["Y"].isNull())
|
||||
data_.location.y = std::stoi(locationNode["Y"].asString());
|
||||
if(!locationNode["Width"].isNull())
|
||||
data_.location.width = std::stoi(locationNode["Width"].asString());
|
||||
if(!locationNode["Height"].isNull())
|
||||
data_.location.height = std::stoi(locationNode["Height"].asString());
|
||||
|
||||
}
|
||||
|
||||
DetectMainBodyResult::Data DetectMainBodyResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
objectdet/src/model/DetectObjectRequest.cc
Normal file
40
objectdet/src/model/DetectObjectRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/DetectObjectRequest.h>
|
||||
|
||||
using AlibabaCloud::Objectdet::Model::DetectObjectRequest;
|
||||
|
||||
DetectObjectRequest::DetectObjectRequest() :
|
||||
RpcServiceRequest("objectdet", "2019-12-30", "DetectObject")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DetectObjectRequest::~DetectObjectRequest()
|
||||
{}
|
||||
|
||||
std::string DetectObjectRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void DetectObjectRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
67
objectdet/src/model/DetectObjectResult.cc
Normal file
67
objectdet/src/model/DetectObjectResult.cc
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/DetectObjectResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Objectdet;
|
||||
using namespace AlibabaCloud::Objectdet::Model;
|
||||
|
||||
DetectObjectResult::DetectObjectResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DetectObjectResult::DetectObjectResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DetectObjectResult::~DetectObjectResult()
|
||||
{}
|
||||
|
||||
void DetectObjectResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Width"].isNull())
|
||||
data_.width = std::stoi(dataNode["Width"].asString());
|
||||
if(!dataNode["Height"].isNull())
|
||||
data_.height = std::stoi(dataNode["Height"].asString());
|
||||
auto allElementsNode = dataNode["Elements"]["Element"];
|
||||
for (auto dataNodeElementsElement : allElementsNode)
|
||||
{
|
||||
Data::Element elementObject;
|
||||
if(!dataNodeElementsElement["Score"].isNull())
|
||||
elementObject.score = std::stof(dataNodeElementsElement["Score"].asString());
|
||||
if(!dataNodeElementsElement["Type"].isNull())
|
||||
elementObject.type = dataNodeElementsElement["Type"].asString();
|
||||
auto allBoxes = value["Boxes"]["Box"];
|
||||
for (auto value : allBoxes)
|
||||
elementObject.boxes.push_back(value.asString());
|
||||
data_.elements.push_back(elementObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DetectObjectResult::Data DetectObjectResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
objectdet/src/model/DetectTransparentImageRequest.cc
Normal file
40
objectdet/src/model/DetectTransparentImageRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/DetectTransparentImageRequest.h>
|
||||
|
||||
using AlibabaCloud::Objectdet::Model::DetectTransparentImageRequest;
|
||||
|
||||
DetectTransparentImageRequest::DetectTransparentImageRequest() :
|
||||
RpcServiceRequest("objectdet", "2019-12-30", "DetectTransparentImage")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DetectTransparentImageRequest::~DetectTransparentImageRequest()
|
||||
{}
|
||||
|
||||
std::string DetectTransparentImageRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void DetectTransparentImageRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
58
objectdet/src/model/DetectTransparentImageResult.cc
Normal file
58
objectdet/src/model/DetectTransparentImageResult.cc
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/DetectTransparentImageResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Objectdet;
|
||||
using namespace AlibabaCloud::Objectdet::Model;
|
||||
|
||||
DetectTransparentImageResult::DetectTransparentImageResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DetectTransparentImageResult::DetectTransparentImageResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DetectTransparentImageResult::~DetectTransparentImageResult()
|
||||
{}
|
||||
|
||||
void DetectTransparentImageResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allElementsNode = dataNode["Elements"]["Element"];
|
||||
for (auto dataNodeElementsElement : allElementsNode)
|
||||
{
|
||||
Data::Element elementObject;
|
||||
if(!dataNodeElementsElement["TransparentImage"].isNull())
|
||||
elementObject.transparentImage = std::stoi(dataNodeElementsElement["TransparentImage"].asString());
|
||||
data_.elements.push_back(elementObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DetectTransparentImageResult::Data DetectTransparentImageResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
objectdet/src/model/DetectVehicleRequest.cc
Normal file
51
objectdet/src/model/DetectVehicleRequest.cc
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/DetectVehicleRequest.h>
|
||||
|
||||
using AlibabaCloud::Objectdet::Model::DetectVehicleRequest;
|
||||
|
||||
DetectVehicleRequest::DetectVehicleRequest() :
|
||||
RpcServiceRequest("objectdet", "2019-12-30", "DetectVehicle")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DetectVehicleRequest::~DetectVehicleRequest()
|
||||
{}
|
||||
|
||||
int DetectVehicleRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void DetectVehicleRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string DetectVehicleRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void DetectVehicleRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
69
objectdet/src/model/DetectVehicleResult.cc
Normal file
69
objectdet/src/model/DetectVehicleResult.cc
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/DetectVehicleResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Objectdet;
|
||||
using namespace AlibabaCloud::Objectdet::Model;
|
||||
|
||||
DetectVehicleResult::DetectVehicleResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DetectVehicleResult::DetectVehicleResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DetectVehicleResult::~DetectVehicleResult()
|
||||
{}
|
||||
|
||||
void DetectVehicleResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["Width"].isNull())
|
||||
data_.width = std::stoi(dataNode["Width"].asString());
|
||||
if(!dataNode["Height"].isNull())
|
||||
data_.height = std::stoi(dataNode["Height"].asString());
|
||||
auto allDetectObjectInfoListNode = dataNode["DetectObjectInfoList"]["DetectObjectInfo"];
|
||||
for (auto dataNodeDetectObjectInfoListDetectObjectInfo : allDetectObjectInfoListNode)
|
||||
{
|
||||
Data::DetectObjectInfo detectObjectInfoObject;
|
||||
if(!dataNodeDetectObjectInfoListDetectObjectInfo["Score"].isNull())
|
||||
detectObjectInfoObject.score = std::stof(dataNodeDetectObjectInfoListDetectObjectInfo["Score"].asString());
|
||||
if(!dataNodeDetectObjectInfoListDetectObjectInfo["Type"].isNull())
|
||||
detectObjectInfoObject.type = dataNodeDetectObjectInfoListDetectObjectInfo["Type"].asString();
|
||||
if(!dataNodeDetectObjectInfoListDetectObjectInfo["Id"].isNull())
|
||||
detectObjectInfoObject.id = std::stoi(dataNodeDetectObjectInfoListDetectObjectInfo["Id"].asString());
|
||||
auto allBoxes = value["Boxes"]["Box"];
|
||||
for (auto value : allBoxes)
|
||||
detectObjectInfoObject.boxes.push_back(value.asString());
|
||||
data_.detectObjectInfoList.push_back(detectObjectInfoObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DetectVehicleResult::Data DetectVehicleResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
objectdet/src/model/DetectWhiteBaseImageRequest.cc
Normal file
40
objectdet/src/model/DetectWhiteBaseImageRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/DetectWhiteBaseImageRequest.h>
|
||||
|
||||
using AlibabaCloud::Objectdet::Model::DetectWhiteBaseImageRequest;
|
||||
|
||||
DetectWhiteBaseImageRequest::DetectWhiteBaseImageRequest() :
|
||||
RpcServiceRequest("objectdet", "2019-12-30", "DetectWhiteBaseImage")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DetectWhiteBaseImageRequest::~DetectWhiteBaseImageRequest()
|
||||
{}
|
||||
|
||||
std::string DetectWhiteBaseImageRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void DetectWhiteBaseImageRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
58
objectdet/src/model/DetectWhiteBaseImageResult.cc
Normal file
58
objectdet/src/model/DetectWhiteBaseImageResult.cc
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/DetectWhiteBaseImageResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Objectdet;
|
||||
using namespace AlibabaCloud::Objectdet::Model;
|
||||
|
||||
DetectWhiteBaseImageResult::DetectWhiteBaseImageResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DetectWhiteBaseImageResult::DetectWhiteBaseImageResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DetectWhiteBaseImageResult::~DetectWhiteBaseImageResult()
|
||||
{}
|
||||
|
||||
void DetectWhiteBaseImageResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allElementsNode = dataNode["Elements"]["Element"];
|
||||
for (auto dataNodeElementsElement : allElementsNode)
|
||||
{
|
||||
Data::Element elementObject;
|
||||
if(!dataNodeElementsElement["WhiteBase"].isNull())
|
||||
elementObject.whiteBase = std::stoi(dataNodeElementsElement["WhiteBase"].asString());
|
||||
data_.elements.push_back(elementObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DetectWhiteBaseImageResult::Data DetectWhiteBaseImageResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
45
objectdet/src/model/GenerateVehicleRepairPlanRequest.cc
Normal file
45
objectdet/src/model/GenerateVehicleRepairPlanRequest.cc
Normal file
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/GenerateVehicleRepairPlanRequest.h>
|
||||
|
||||
using AlibabaCloud::Objectdet::Model::GenerateVehicleRepairPlanRequest;
|
||||
|
||||
GenerateVehicleRepairPlanRequest::GenerateVehicleRepairPlanRequest() :
|
||||
RpcServiceRequest("objectdet", "2019-12-30", "GenerateVehicleRepairPlan")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GenerateVehicleRepairPlanRequest::~GenerateVehicleRepairPlanRequest()
|
||||
{}
|
||||
|
||||
std::vector<GenerateVehicleRepairPlanRequest::DamageImageList> GenerateVehicleRepairPlanRequest::getDamageImageList()const
|
||||
{
|
||||
return damageImageList_;
|
||||
}
|
||||
|
||||
void GenerateVehicleRepairPlanRequest::setDamageImageList(const std::vector<DamageImageList>& damageImageList)
|
||||
{
|
||||
damageImageList_ = damageImageList;
|
||||
for(int dep1 = 0; dep1!= damageImageList.size(); dep1++) {
|
||||
auto damageImageListObj = damageImageList.at(dep1);
|
||||
std::string damageImageListObjStr = "DamageImageList." + std::to_string(dep1 + 1);
|
||||
setParameter(damageImageListObjStr + ".ImageUrl", damageImageListObj.imageUrl);
|
||||
setParameter(damageImageListObjStr + ".CreateTimeStamp", damageImageListObj.createTimeStamp);
|
||||
}
|
||||
}
|
||||
|
||||
80
objectdet/src/model/GenerateVehicleRepairPlanResult.cc
Normal file
80
objectdet/src/model/GenerateVehicleRepairPlanResult.cc
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/GenerateVehicleRepairPlanResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Objectdet;
|
||||
using namespace AlibabaCloud::Objectdet::Model;
|
||||
|
||||
GenerateVehicleRepairPlanResult::GenerateVehicleRepairPlanResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GenerateVehicleRepairPlanResult::GenerateVehicleRepairPlanResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GenerateVehicleRepairPlanResult::~GenerateVehicleRepairPlanResult()
|
||||
{}
|
||||
|
||||
void GenerateVehicleRepairPlanResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["TaskId"].isNull())
|
||||
data_.taskId = dataNode["TaskId"].asString();
|
||||
if(!value["HttpCode"].isNull())
|
||||
httpCode_ = std::stoi(value["HttpCode"].asString());
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["ErrorMessage"].isNull())
|
||||
errorMessage_ = value["ErrorMessage"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
|
||||
}
|
||||
|
||||
int GenerateVehicleRepairPlanResult::getHttpCode()const
|
||||
{
|
||||
return httpCode_;
|
||||
}
|
||||
|
||||
GenerateVehicleRepairPlanResult::Data GenerateVehicleRepairPlanResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string GenerateVehicleRepairPlanResult::getErrorMessage()const
|
||||
{
|
||||
return errorMessage_;
|
||||
}
|
||||
|
||||
std::string GenerateVehicleRepairPlanResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool GenerateVehicleRepairPlanResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
62
objectdet/src/model/GetVehicleRepairPlanRequest.cc
Normal file
62
objectdet/src/model/GetVehicleRepairPlanRequest.cc
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/GetVehicleRepairPlanRequest.h>
|
||||
|
||||
using AlibabaCloud::Objectdet::Model::GetVehicleRepairPlanRequest;
|
||||
|
||||
GetVehicleRepairPlanRequest::GetVehicleRepairPlanRequest() :
|
||||
RpcServiceRequest("objectdet", "2019-12-30", "GetVehicleRepairPlan")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
GetVehicleRepairPlanRequest::~GetVehicleRepairPlanRequest()
|
||||
{}
|
||||
|
||||
std::string GetVehicleRepairPlanRequest::getVinCodeImage()const
|
||||
{
|
||||
return vinCodeImage_;
|
||||
}
|
||||
|
||||
void GetVehicleRepairPlanRequest::setVinCodeImage(const std::string& vinCodeImage)
|
||||
{
|
||||
vinCodeImage_ = vinCodeImage;
|
||||
setBodyParameter("VinCodeImage", vinCodeImage);
|
||||
}
|
||||
|
||||
std::string GetVehicleRepairPlanRequest::getCarNumberImage()const
|
||||
{
|
||||
return carNumberImage_;
|
||||
}
|
||||
|
||||
void GetVehicleRepairPlanRequest::setCarNumberImage(const std::string& carNumberImage)
|
||||
{
|
||||
carNumberImage_ = carNumberImage;
|
||||
setBodyParameter("CarNumberImage", carNumberImage);
|
||||
}
|
||||
|
||||
std::string GetVehicleRepairPlanRequest::getTaskId()const
|
||||
{
|
||||
return taskId_;
|
||||
}
|
||||
|
||||
void GetVehicleRepairPlanRequest::setTaskId(const std::string& taskId)
|
||||
{
|
||||
taskId_ = taskId;
|
||||
setBodyParameter("TaskId", taskId);
|
||||
}
|
||||
|
||||
108
objectdet/src/model/GetVehicleRepairPlanResult.cc
Normal file
108
objectdet/src/model/GetVehicleRepairPlanResult.cc
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/GetVehicleRepairPlanResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Objectdet;
|
||||
using namespace AlibabaCloud::Objectdet::Model;
|
||||
|
||||
GetVehicleRepairPlanResult::GetVehicleRepairPlanResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
GetVehicleRepairPlanResult::GetVehicleRepairPlanResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
GetVehicleRepairPlanResult::~GetVehicleRepairPlanResult()
|
||||
{}
|
||||
|
||||
void GetVehicleRepairPlanResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
if(!dataNode["FrameNo"].isNull())
|
||||
data_.frameNo = dataNode["FrameNo"].asString();
|
||||
auto allRepairPartsNode = dataNode["RepairParts"]["RepairItems"];
|
||||
for (auto dataNodeRepairPartsRepairItems : allRepairPartsNode)
|
||||
{
|
||||
Data::RepairItems repairItemsObject;
|
||||
if(!dataNodeRepairPartsRepairItems["GarageType"].isNull())
|
||||
repairItemsObject.garageType = dataNodeRepairPartsRepairItems["GarageType"].asString();
|
||||
if(!dataNodeRepairPartsRepairItems["OeMatch"].isNull())
|
||||
repairItemsObject.oeMatch = dataNodeRepairPartsRepairItems["OeMatch"].asString() == "true";
|
||||
if(!dataNodeRepairPartsRepairItems["OutStandardPartsId"].isNull())
|
||||
repairItemsObject.outStandardPartsId = dataNodeRepairPartsRepairItems["OutStandardPartsId"].asString();
|
||||
if(!dataNodeRepairPartsRepairItems["OutStandardPartsName"].isNull())
|
||||
repairItemsObject.outStandardPartsName = dataNodeRepairPartsRepairItems["OutStandardPartsName"].asString();
|
||||
if(!dataNodeRepairPartsRepairItems["PartNameMatch"].isNull())
|
||||
repairItemsObject.partNameMatch = dataNodeRepairPartsRepairItems["PartNameMatch"].asString() == "true";
|
||||
if(!dataNodeRepairPartsRepairItems["PartsStdCode"].isNull())
|
||||
repairItemsObject.partsStdCode = dataNodeRepairPartsRepairItems["PartsStdCode"].asString();
|
||||
if(!dataNodeRepairPartsRepairItems["PartsStdName"].isNull())
|
||||
repairItemsObject.partsStdName = dataNodeRepairPartsRepairItems["PartsStdName"].asString();
|
||||
if(!dataNodeRepairPartsRepairItems["RelationType"].isNull())
|
||||
repairItemsObject.relationType = dataNodeRepairPartsRepairItems["RelationType"].asString();
|
||||
if(!dataNodeRepairPartsRepairItems["RepairFee"].isNull())
|
||||
repairItemsObject.repairFee = dataNodeRepairPartsRepairItems["RepairFee"].asString();
|
||||
if(!dataNodeRepairPartsRepairItems["RepairType"].isNull())
|
||||
repairItemsObject.repairType = dataNodeRepairPartsRepairItems["RepairType"].asString();
|
||||
if(!dataNodeRepairPartsRepairItems["RepairTypeName"].isNull())
|
||||
repairItemsObject.repairTypeName = dataNodeRepairPartsRepairItems["RepairTypeName"].asString();
|
||||
data_.repairParts.push_back(repairItemsObject);
|
||||
}
|
||||
if(!value["Code"].isNull())
|
||||
code_ = value["Code"].asString();
|
||||
if(!value["ErrorMessage"].isNull())
|
||||
errorMessage_ = value["ErrorMessage"].asString();
|
||||
if(!value["Success"].isNull())
|
||||
success_ = value["Success"].asString() == "true";
|
||||
if(!value["HttpCode"].isNull())
|
||||
httpCode_ = std::stoi(value["HttpCode"].asString());
|
||||
|
||||
}
|
||||
|
||||
int GetVehicleRepairPlanResult::getHttpCode()const
|
||||
{
|
||||
return httpCode_;
|
||||
}
|
||||
|
||||
GetVehicleRepairPlanResult::Data GetVehicleRepairPlanResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
std::string GetVehicleRepairPlanResult::getErrorMessage()const
|
||||
{
|
||||
return errorMessage_;
|
||||
}
|
||||
|
||||
std::string GetVehicleRepairPlanResult::getCode()const
|
||||
{
|
||||
return code_;
|
||||
}
|
||||
|
||||
bool GetVehicleRepairPlanResult::getSuccess()const
|
||||
{
|
||||
return success_;
|
||||
}
|
||||
|
||||
40
objectdet/src/model/RecognizeVehicleDamageRequest.cc
Normal file
40
objectdet/src/model/RecognizeVehicleDamageRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/RecognizeVehicleDamageRequest.h>
|
||||
|
||||
using AlibabaCloud::Objectdet::Model::RecognizeVehicleDamageRequest;
|
||||
|
||||
RecognizeVehicleDamageRequest::RecognizeVehicleDamageRequest() :
|
||||
RpcServiceRequest("objectdet", "2019-12-30", "RecognizeVehicleDamage")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeVehicleDamageRequest::~RecognizeVehicleDamageRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizeVehicleDamageRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeVehicleDamageRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
66
objectdet/src/model/RecognizeVehicleDamageResult.cc
Normal file
66
objectdet/src/model/RecognizeVehicleDamageResult.cc
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/RecognizeVehicleDamageResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Objectdet;
|
||||
using namespace AlibabaCloud::Objectdet::Model;
|
||||
|
||||
RecognizeVehicleDamageResult::RecognizeVehicleDamageResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeVehicleDamageResult::RecognizeVehicleDamageResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeVehicleDamageResult::~RecognizeVehicleDamageResult()
|
||||
{}
|
||||
|
||||
void RecognizeVehicleDamageResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allElementsNode = dataNode["Elements"]["Element"];
|
||||
for (auto dataNodeElementsElement : allElementsNode)
|
||||
{
|
||||
Data::Element elementObject;
|
||||
if(!dataNodeElementsElement["Score"].isNull())
|
||||
elementObject.score = std::stof(dataNodeElementsElement["Score"].asString());
|
||||
if(!dataNodeElementsElement["Type"].isNull())
|
||||
elementObject.type = dataNodeElementsElement["Type"].asString();
|
||||
auto allScores = value["Scores"]["Score"];
|
||||
for (auto value : allScores)
|
||||
elementObject.scores.push_back(value.asString());
|
||||
auto allBoxes = value["Boxes"]["Box"];
|
||||
for (auto value : allBoxes)
|
||||
elementObject.boxes.push_back(value.asString());
|
||||
data_.elements.push_back(elementObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RecognizeVehicleDamageResult::Data RecognizeVehicleDamageResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
objectdet/src/model/RecognizeVehicleDashboardRequest.cc
Normal file
40
objectdet/src/model/RecognizeVehicleDashboardRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/RecognizeVehicleDashboardRequest.h>
|
||||
|
||||
using AlibabaCloud::Objectdet::Model::RecognizeVehicleDashboardRequest;
|
||||
|
||||
RecognizeVehicleDashboardRequest::RecognizeVehicleDashboardRequest() :
|
||||
RpcServiceRequest("objectdet", "2019-12-30", "RecognizeVehicleDashboard")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeVehicleDashboardRequest::~RecognizeVehicleDashboardRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizeVehicleDashboardRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeVehicleDashboardRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
65
objectdet/src/model/RecognizeVehicleDashboardResult.cc
Normal file
65
objectdet/src/model/RecognizeVehicleDashboardResult.cc
Normal file
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/RecognizeVehicleDashboardResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Objectdet;
|
||||
using namespace AlibabaCloud::Objectdet::Model;
|
||||
|
||||
RecognizeVehicleDashboardResult::RecognizeVehicleDashboardResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeVehicleDashboardResult::RecognizeVehicleDashboardResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeVehicleDashboardResult::~RecognizeVehicleDashboardResult()
|
||||
{}
|
||||
|
||||
void RecognizeVehicleDashboardResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allElementsNode = dataNode["Elements"]["Element"];
|
||||
for (auto dataNodeElementsElement : allElementsNode)
|
||||
{
|
||||
Data::Element elementObject;
|
||||
if(!dataNodeElementsElement["Score"].isNull())
|
||||
elementObject.score = std::stof(dataNodeElementsElement["Score"].asString());
|
||||
if(!dataNodeElementsElement["ClassName"].isNull())
|
||||
elementObject.className = dataNodeElementsElement["ClassName"].asString();
|
||||
if(!dataNodeElementsElement["Label"].isNull())
|
||||
elementObject.label = dataNodeElementsElement["Label"].asString();
|
||||
auto allBoxes = value["Boxes"]["Box"];
|
||||
for (auto value : allBoxes)
|
||||
elementObject.boxes.push_back(value.asString());
|
||||
data_.elements.push_back(elementObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RecognizeVehicleDashboardResult::Data RecognizeVehicleDashboardResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
objectdet/src/model/RecognizeVehiclePartsRequest.cc
Normal file
40
objectdet/src/model/RecognizeVehiclePartsRequest.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/RecognizeVehiclePartsRequest.h>
|
||||
|
||||
using AlibabaCloud::Objectdet::Model::RecognizeVehiclePartsRequest;
|
||||
|
||||
RecognizeVehiclePartsRequest::RecognizeVehiclePartsRequest() :
|
||||
RpcServiceRequest("objectdet", "2019-12-30", "RecognizeVehicleParts")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeVehiclePartsRequest::~RecognizeVehiclePartsRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizeVehiclePartsRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeVehiclePartsRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
66
objectdet/src/model/RecognizeVehiclePartsResult.cc
Normal file
66
objectdet/src/model/RecognizeVehiclePartsResult.cc
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#include <alibabacloud/objectdet/model/RecognizeVehiclePartsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Objectdet;
|
||||
using namespace AlibabaCloud::Objectdet::Model;
|
||||
|
||||
RecognizeVehiclePartsResult::RecognizeVehiclePartsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeVehiclePartsResult::RecognizeVehiclePartsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeVehiclePartsResult::~RecognizeVehiclePartsResult()
|
||||
{}
|
||||
|
||||
void RecognizeVehiclePartsResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allElementsNode = dataNode["Elements"]["Element"];
|
||||
for (auto dataNodeElementsElement : allElementsNode)
|
||||
{
|
||||
Data::Element elementObject;
|
||||
if(!dataNodeElementsElement["Score"].isNull())
|
||||
elementObject.score = std::stof(dataNodeElementsElement["Score"].asString());
|
||||
if(!dataNodeElementsElement["Type"].isNull())
|
||||
elementObject.type = dataNodeElementsElement["Type"].asString();
|
||||
auto allBoxes = value["Boxes"]["Box"];
|
||||
for (auto value : allBoxes)
|
||||
elementObject.boxes.push_back(value.asString());
|
||||
data_.elements.push_back(elementObject);
|
||||
}
|
||||
auto allOriginShapes = dataNode["OriginShapes"]["OriginShape"];
|
||||
for (auto value : allOriginShapes)
|
||||
data_.originShapes.push_back(value.asString());
|
||||
|
||||
}
|
||||
|
||||
RecognizeVehiclePartsResult::Data RecognizeVehiclePartsResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user