Compare commits
2 Commits
goodstech-
...
imgsearch-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7b81546c4 | ||
|
|
7f711be94a |
@@ -1,3 +1,9 @@
|
||||
2020-11-16 Version: patch
|
||||
- Update imgsearch.
|
||||
|
||||
2020-11-16 Version: patch
|
||||
- Update imagerecog.
|
||||
|
||||
2020-11-16 Version: patch
|
||||
- Update goodstech.
|
||||
|
||||
|
||||
118
imagerecog/CMakeLists.txt
Normal file
118
imagerecog/CMakeLists.txt
Normal file
@@ -0,0 +1,118 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
set(public_header_dir ${CMAKE_CURRENT_SOURCE_DIR}/../include)
|
||||
|
||||
set(imagerecog_public_header
|
||||
include/alibabacloud/imagerecog/ImagerecogClient.h
|
||||
include/alibabacloud/imagerecog/ImagerecogExport.h )
|
||||
|
||||
set(imagerecog_public_header_model
|
||||
include/alibabacloud/imagerecog/model/ClassifyingRubbishRequest.h
|
||||
include/alibabacloud/imagerecog/model/ClassifyingRubbishResult.h
|
||||
include/alibabacloud/imagerecog/model/DetectFruitsRequest.h
|
||||
include/alibabacloud/imagerecog/model/DetectFruitsResult.h
|
||||
include/alibabacloud/imagerecog/model/DetectImageElementsRequest.h
|
||||
include/alibabacloud/imagerecog/model/DetectImageElementsResult.h
|
||||
include/alibabacloud/imagerecog/model/RecognizeImageColorRequest.h
|
||||
include/alibabacloud/imagerecog/model/RecognizeImageColorResult.h
|
||||
include/alibabacloud/imagerecog/model/RecognizeImageStyleRequest.h
|
||||
include/alibabacloud/imagerecog/model/RecognizeImageStyleResult.h
|
||||
include/alibabacloud/imagerecog/model/RecognizeLogoRequest.h
|
||||
include/alibabacloud/imagerecog/model/RecognizeLogoResult.h
|
||||
include/alibabacloud/imagerecog/model/RecognizeSceneRequest.h
|
||||
include/alibabacloud/imagerecog/model/RecognizeSceneResult.h
|
||||
include/alibabacloud/imagerecog/model/RecognizeVehicleTypeRequest.h
|
||||
include/alibabacloud/imagerecog/model/RecognizeVehicleTypeResult.h
|
||||
include/alibabacloud/imagerecog/model/TaggingImageRequest.h
|
||||
include/alibabacloud/imagerecog/model/TaggingImageResult.h )
|
||||
|
||||
set(imagerecog_src
|
||||
src/ImagerecogClient.cc
|
||||
src/model/ClassifyingRubbishRequest.cc
|
||||
src/model/ClassifyingRubbishResult.cc
|
||||
src/model/DetectFruitsRequest.cc
|
||||
src/model/DetectFruitsResult.cc
|
||||
src/model/DetectImageElementsRequest.cc
|
||||
src/model/DetectImageElementsResult.cc
|
||||
src/model/RecognizeImageColorRequest.cc
|
||||
src/model/RecognizeImageColorResult.cc
|
||||
src/model/RecognizeImageStyleRequest.cc
|
||||
src/model/RecognizeImageStyleResult.cc
|
||||
src/model/RecognizeLogoRequest.cc
|
||||
src/model/RecognizeLogoResult.cc
|
||||
src/model/RecognizeSceneRequest.cc
|
||||
src/model/RecognizeSceneResult.cc
|
||||
src/model/RecognizeVehicleTypeRequest.cc
|
||||
src/model/RecognizeVehicleTypeResult.cc
|
||||
src/model/TaggingImageRequest.cc
|
||||
src/model/TaggingImageResult.cc )
|
||||
|
||||
add_library(imagerecog ${LIB_TYPE}
|
||||
${imagerecog_public_header}
|
||||
${imagerecog_public_header_model}
|
||||
${imagerecog_src})
|
||||
|
||||
set_target_properties(imagerecog
|
||||
PROPERTIES
|
||||
LINKER_LANGUAGE CXX
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
|
||||
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
OUTPUT_NAME ${TARGET_OUTPUT_NAME_PREFIX}imagerecog
|
||||
)
|
||||
|
||||
if(${LIB_TYPE} STREQUAL "SHARED")
|
||||
set_target_properties(imagerecog
|
||||
PROPERTIES
|
||||
DEFINE_SYMBOL ALIBABACLOUD_IMAGERECOG_LIBRARY)
|
||||
endif()
|
||||
|
||||
target_include_directories(imagerecog
|
||||
PRIVATE include
|
||||
${CMAKE_SOURCE_DIR}/core/include
|
||||
)
|
||||
target_link_libraries(imagerecog
|
||||
core)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
ExternalProject_Get_Property(jsoncpp INSTALL_DIR)
|
||||
set(jsoncpp_install_dir ${INSTALL_DIR})
|
||||
add_dependencies(imagerecog
|
||||
jsoncpp)
|
||||
target_include_directories(imagerecog
|
||||
PRIVATE ${jsoncpp_install_dir}/include)
|
||||
target_link_libraries(imagerecog
|
||||
${jsoncpp_install_dir}/lib/jsoncpp.lib)
|
||||
set_target_properties(imagerecog
|
||||
PROPERTIES
|
||||
COMPILE_OPTIONS "/bigobj")
|
||||
else()
|
||||
target_include_directories(imagerecog
|
||||
PRIVATE /usr/include/jsoncpp)
|
||||
target_link_libraries(imagerecog
|
||||
jsoncpp)
|
||||
endif()
|
||||
|
||||
install(FILES ${imagerecog_public_header}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/imagerecog)
|
||||
install(FILES ${imagerecog_public_header_model}
|
||||
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/alibabacloud/imagerecog/model)
|
||||
install(TARGETS imagerecog
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
118
imagerecog/include/alibabacloud/imagerecog/ImagerecogClient.h
Normal file
118
imagerecog/include/alibabacloud/imagerecog/ImagerecogClient.h
Normal file
@@ -0,0 +1,118 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_IMAGERECOGCLIENT_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_IMAGERECOGCLIENT_H_
|
||||
|
||||
#include <future>
|
||||
#include <alibabacloud/core/AsyncCallerContext.h>
|
||||
#include <alibabacloud/core/EndpointProvider.h>
|
||||
#include <alibabacloud/core/RpcServiceClient.h>
|
||||
#include "ImagerecogExport.h"
|
||||
#include "model/ClassifyingRubbishRequest.h"
|
||||
#include "model/ClassifyingRubbishResult.h"
|
||||
#include "model/DetectFruitsRequest.h"
|
||||
#include "model/DetectFruitsResult.h"
|
||||
#include "model/DetectImageElementsRequest.h"
|
||||
#include "model/DetectImageElementsResult.h"
|
||||
#include "model/RecognizeImageColorRequest.h"
|
||||
#include "model/RecognizeImageColorResult.h"
|
||||
#include "model/RecognizeImageStyleRequest.h"
|
||||
#include "model/RecognizeImageStyleResult.h"
|
||||
#include "model/RecognizeLogoRequest.h"
|
||||
#include "model/RecognizeLogoResult.h"
|
||||
#include "model/RecognizeSceneRequest.h"
|
||||
#include "model/RecognizeSceneResult.h"
|
||||
#include "model/RecognizeVehicleTypeRequest.h"
|
||||
#include "model/RecognizeVehicleTypeResult.h"
|
||||
#include "model/TaggingImageRequest.h"
|
||||
#include "model/TaggingImageResult.h"
|
||||
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT ImagerecogClient : public RpcServiceClient
|
||||
{
|
||||
public:
|
||||
typedef Outcome<Error, Model::ClassifyingRubbishResult> ClassifyingRubbishOutcome;
|
||||
typedef std::future<ClassifyingRubbishOutcome> ClassifyingRubbishOutcomeCallable;
|
||||
typedef std::function<void(const ImagerecogClient*, const Model::ClassifyingRubbishRequest&, const ClassifyingRubbishOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> ClassifyingRubbishAsyncHandler;
|
||||
typedef Outcome<Error, Model::DetectFruitsResult> DetectFruitsOutcome;
|
||||
typedef std::future<DetectFruitsOutcome> DetectFruitsOutcomeCallable;
|
||||
typedef std::function<void(const ImagerecogClient*, const Model::DetectFruitsRequest&, const DetectFruitsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectFruitsAsyncHandler;
|
||||
typedef Outcome<Error, Model::DetectImageElementsResult> DetectImageElementsOutcome;
|
||||
typedef std::future<DetectImageElementsOutcome> DetectImageElementsOutcomeCallable;
|
||||
typedef std::function<void(const ImagerecogClient*, const Model::DetectImageElementsRequest&, const DetectImageElementsOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> DetectImageElementsAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeImageColorResult> RecognizeImageColorOutcome;
|
||||
typedef std::future<RecognizeImageColorOutcome> RecognizeImageColorOutcomeCallable;
|
||||
typedef std::function<void(const ImagerecogClient*, const Model::RecognizeImageColorRequest&, const RecognizeImageColorOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeImageColorAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeImageStyleResult> RecognizeImageStyleOutcome;
|
||||
typedef std::future<RecognizeImageStyleOutcome> RecognizeImageStyleOutcomeCallable;
|
||||
typedef std::function<void(const ImagerecogClient*, const Model::RecognizeImageStyleRequest&, const RecognizeImageStyleOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeImageStyleAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeLogoResult> RecognizeLogoOutcome;
|
||||
typedef std::future<RecognizeLogoOutcome> RecognizeLogoOutcomeCallable;
|
||||
typedef std::function<void(const ImagerecogClient*, const Model::RecognizeLogoRequest&, const RecognizeLogoOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeLogoAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeSceneResult> RecognizeSceneOutcome;
|
||||
typedef std::future<RecognizeSceneOutcome> RecognizeSceneOutcomeCallable;
|
||||
typedef std::function<void(const ImagerecogClient*, const Model::RecognizeSceneRequest&, const RecognizeSceneOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeSceneAsyncHandler;
|
||||
typedef Outcome<Error, Model::RecognizeVehicleTypeResult> RecognizeVehicleTypeOutcome;
|
||||
typedef std::future<RecognizeVehicleTypeOutcome> RecognizeVehicleTypeOutcomeCallable;
|
||||
typedef std::function<void(const ImagerecogClient*, const Model::RecognizeVehicleTypeRequest&, const RecognizeVehicleTypeOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> RecognizeVehicleTypeAsyncHandler;
|
||||
typedef Outcome<Error, Model::TaggingImageResult> TaggingImageOutcome;
|
||||
typedef std::future<TaggingImageOutcome> TaggingImageOutcomeCallable;
|
||||
typedef std::function<void(const ImagerecogClient*, const Model::TaggingImageRequest&, const TaggingImageOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> TaggingImageAsyncHandler;
|
||||
|
||||
ImagerecogClient(const Credentials &credentials, const ClientConfiguration &configuration);
|
||||
ImagerecogClient(const std::shared_ptr<CredentialsProvider> &credentialsProvider, const ClientConfiguration &configuration);
|
||||
ImagerecogClient(const std::string &accessKeyId, const std::string &accessKeySecret, const ClientConfiguration &configuration);
|
||||
~ImagerecogClient();
|
||||
ClassifyingRubbishOutcome classifyingRubbish(const Model::ClassifyingRubbishRequest &request)const;
|
||||
void classifyingRubbishAsync(const Model::ClassifyingRubbishRequest& request, const ClassifyingRubbishAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
ClassifyingRubbishOutcomeCallable classifyingRubbishCallable(const Model::ClassifyingRubbishRequest& request) const;
|
||||
DetectFruitsOutcome detectFruits(const Model::DetectFruitsRequest &request)const;
|
||||
void detectFruitsAsync(const Model::DetectFruitsRequest& request, const DetectFruitsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DetectFruitsOutcomeCallable detectFruitsCallable(const Model::DetectFruitsRequest& request) const;
|
||||
DetectImageElementsOutcome detectImageElements(const Model::DetectImageElementsRequest &request)const;
|
||||
void detectImageElementsAsync(const Model::DetectImageElementsRequest& request, const DetectImageElementsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
DetectImageElementsOutcomeCallable detectImageElementsCallable(const Model::DetectImageElementsRequest& request) const;
|
||||
RecognizeImageColorOutcome recognizeImageColor(const Model::RecognizeImageColorRequest &request)const;
|
||||
void recognizeImageColorAsync(const Model::RecognizeImageColorRequest& request, const RecognizeImageColorAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeImageColorOutcomeCallable recognizeImageColorCallable(const Model::RecognizeImageColorRequest& request) const;
|
||||
RecognizeImageStyleOutcome recognizeImageStyle(const Model::RecognizeImageStyleRequest &request)const;
|
||||
void recognizeImageStyleAsync(const Model::RecognizeImageStyleRequest& request, const RecognizeImageStyleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeImageStyleOutcomeCallable recognizeImageStyleCallable(const Model::RecognizeImageStyleRequest& request) const;
|
||||
RecognizeLogoOutcome recognizeLogo(const Model::RecognizeLogoRequest &request)const;
|
||||
void recognizeLogoAsync(const Model::RecognizeLogoRequest& request, const RecognizeLogoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeLogoOutcomeCallable recognizeLogoCallable(const Model::RecognizeLogoRequest& request) const;
|
||||
RecognizeSceneOutcome recognizeScene(const Model::RecognizeSceneRequest &request)const;
|
||||
void recognizeSceneAsync(const Model::RecognizeSceneRequest& request, const RecognizeSceneAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeSceneOutcomeCallable recognizeSceneCallable(const Model::RecognizeSceneRequest& request) const;
|
||||
RecognizeVehicleTypeOutcome recognizeVehicleType(const Model::RecognizeVehicleTypeRequest &request)const;
|
||||
void recognizeVehicleTypeAsync(const Model::RecognizeVehicleTypeRequest& request, const RecognizeVehicleTypeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
RecognizeVehicleTypeOutcomeCallable recognizeVehicleTypeCallable(const Model::RecognizeVehicleTypeRequest& request) const;
|
||||
TaggingImageOutcome taggingImage(const Model::TaggingImageRequest &request)const;
|
||||
void taggingImageAsync(const Model::TaggingImageRequest& request, const TaggingImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
|
||||
TaggingImageOutcomeCallable taggingImageCallable(const Model::TaggingImageRequest& request) const;
|
||||
|
||||
private:
|
||||
std::shared_ptr<EndpointProvider> endpointProvider_;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_IMAGERECOGCLIENT_H_
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_IMAGERECOGEXPORT_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_IMAGERECOGEXPORT_H_
|
||||
|
||||
#include <alibabacloud/core/Global.h>
|
||||
|
||||
#if defined(ALIBABACLOUD_SHARED)
|
||||
# if defined(ALIBABACLOUD_IMAGERECOG_LIBRARY)
|
||||
# define ALIBABACLOUD_IMAGERECOG_EXPORT ALIBABACLOUD_DECL_EXPORT
|
||||
# else
|
||||
# define ALIBABACLOUD_IMAGERECOG_EXPORT ALIBABACLOUD_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define ALIBABACLOUD_IMAGERECOG_EXPORT
|
||||
#endif
|
||||
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_IMAGERECOGEXPORT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_CLASSIFYINGRUBBISHREQUEST_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_CLASSIFYINGRUBBISHREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT ClassifyingRubbishRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
ClassifyingRubbishRequest();
|
||||
~ClassifyingRubbishRequest();
|
||||
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_CLASSIFYINGRUBBISHREQUEST_H_
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_CLASSIFYINGRUBBISHRESULT_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_CLASSIFYINGRUBBISHRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT ClassifyingRubbishResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Element
|
||||
{
|
||||
std::string rubbish;
|
||||
std::string category;
|
||||
float categoryScore;
|
||||
float rubbishScore;
|
||||
};
|
||||
bool sensitive;
|
||||
std::vector<Element> elements;
|
||||
};
|
||||
|
||||
|
||||
ClassifyingRubbishResult();
|
||||
explicit ClassifyingRubbishResult(const std::string &payload);
|
||||
~ClassifyingRubbishResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_CLASSIFYINGRUBBISHRESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_DETECTFRUITSREQUEST_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_DETECTFRUITSREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT DetectFruitsRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
DetectFruitsRequest();
|
||||
~DetectFruitsRequest();
|
||||
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_DETECTFRUITSREQUEST_H_
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_DETECTFRUITSRESULT_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_DETECTFRUITSRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT DetectFruitsResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Element
|
||||
{
|
||||
float score;
|
||||
std::vector<std::string> box;
|
||||
std::string name;
|
||||
};
|
||||
std::vector<Element> elements;
|
||||
};
|
||||
|
||||
|
||||
DetectFruitsResult();
|
||||
explicit DetectFruitsResult(const std::string &payload);
|
||||
~DetectFruitsResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_DETECTFRUITSRESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_DETECTIMAGEELEMENTSREQUEST_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_DETECTIMAGEELEMENTSREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT DetectImageElementsRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
DetectImageElementsRequest();
|
||||
~DetectImageElementsRequest();
|
||||
|
||||
std::string getUrl()const;
|
||||
void setUrl(const std::string& url);
|
||||
|
||||
private:
|
||||
std::string url_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_DETECTIMAGEELEMENTSREQUEST_H_
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_DETECTIMAGEELEMENTSRESULT_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_DETECTIMAGEELEMENTSRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT DetectImageElementsResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Element
|
||||
{
|
||||
std::string type;
|
||||
float score;
|
||||
int x;
|
||||
int y;
|
||||
int height;
|
||||
int width;
|
||||
};
|
||||
std::vector<Element> elements;
|
||||
};
|
||||
|
||||
|
||||
DetectImageElementsResult();
|
||||
explicit DetectImageElementsResult(const std::string &payload);
|
||||
~DetectImageElementsResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_DETECTIMAGEELEMENTSRESULT_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGECOLORREQUEST_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGECOLORREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeImageColorRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeImageColorRequest();
|
||||
~RecognizeImageColorRequest();
|
||||
|
||||
std::string getUrl()const;
|
||||
void setUrl(const std::string& url);
|
||||
int getColorCount()const;
|
||||
void setColorCount(int colorCount);
|
||||
|
||||
private:
|
||||
std::string url_;
|
||||
int colorCount_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGECOLORREQUEST_H_
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGECOLORRESULT_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGECOLORRESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeImageColorResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct ColorTemplate
|
||||
{
|
||||
float percentage;
|
||||
std::string color;
|
||||
std::string label;
|
||||
};
|
||||
std::vector<ColorTemplate> colorTemplateList;
|
||||
};
|
||||
|
||||
|
||||
RecognizeImageColorResult();
|
||||
explicit RecognizeImageColorResult(const std::string &payload);
|
||||
~RecognizeImageColorResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGECOLORRESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGESTYLEREQUEST_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGESTYLEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeImageStyleRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeImageStyleRequest();
|
||||
~RecognizeImageStyleRequest();
|
||||
|
||||
std::string getUrl()const;
|
||||
void setUrl(const std::string& url);
|
||||
|
||||
private:
|
||||
std::string url_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGESTYLEREQUEST_H_
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGESTYLERESULT_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGESTYLERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeImageStyleResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
std::vector<std::string> styles;
|
||||
};
|
||||
|
||||
|
||||
RecognizeImageStyleResult();
|
||||
explicit RecognizeImageStyleResult(const std::string &payload);
|
||||
~RecognizeImageStyleResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEIMAGESTYLERESULT_H_
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZELOGOREQUEST_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZELOGOREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeLogoRequest : public RpcServiceRequest
|
||||
{
|
||||
public:
|
||||
struct Tasks
|
||||
{
|
||||
std::string imageURL;
|
||||
};
|
||||
|
||||
public:
|
||||
RecognizeLogoRequest();
|
||||
~RecognizeLogoRequest();
|
||||
|
||||
std::vector<Tasks> getTasks()const;
|
||||
void setTasks(const std::vector<Tasks>& tasks);
|
||||
|
||||
private:
|
||||
std::vector<Tasks> tasks_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZELOGOREQUEST_H_
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZELOGORESULT_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZELOGORESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeLogoResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Element
|
||||
{
|
||||
struct Result
|
||||
{
|
||||
struct LogoData
|
||||
{
|
||||
std::string type;
|
||||
float w;
|
||||
float x;
|
||||
float h;
|
||||
float y;
|
||||
std::string name;
|
||||
};
|
||||
std::string suggestion;
|
||||
std::vector<Result::LogoData> logosData;
|
||||
float rate;
|
||||
std::string label;
|
||||
};
|
||||
std::string taskId;
|
||||
std::vector<Element::Result> results;
|
||||
std::string imageURL;
|
||||
};
|
||||
std::vector<Element> elements;
|
||||
};
|
||||
|
||||
|
||||
RecognizeLogoResult();
|
||||
explicit RecognizeLogoResult(const std::string &payload);
|
||||
~RecognizeLogoResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZELOGORESULT_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZESCENEREQUEST_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZESCENEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeSceneRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeSceneRequest();
|
||||
~RecognizeSceneRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZESCENEREQUEST_H_
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZESCENERESULT_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZESCENERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeSceneResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Tag
|
||||
{
|
||||
float confidence;
|
||||
std::string value;
|
||||
};
|
||||
std::vector<Tag> tags;
|
||||
};
|
||||
|
||||
|
||||
RecognizeSceneResult();
|
||||
explicit RecognizeSceneResult(const std::string &payload);
|
||||
~RecognizeSceneResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZESCENERESULT_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEVEHICLETYPEREQUEST_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEVEHICLETYPEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeVehicleTypeRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
RecognizeVehicleTypeRequest();
|
||||
~RecognizeVehicleTypeRequest();
|
||||
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEVEHICLETYPEREQUEST_H_
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEVEHICLETYPERESULT_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEVEHICLETYPERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT RecognizeVehicleTypeResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Element
|
||||
{
|
||||
float score;
|
||||
std::string name;
|
||||
};
|
||||
std::vector<Element> elements;
|
||||
float threshold;
|
||||
};
|
||||
|
||||
|
||||
RecognizeVehicleTypeResult();
|
||||
explicit RecognizeVehicleTypeResult(const std::string &payload);
|
||||
~RecognizeVehicleTypeResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_RECOGNIZEVEHICLETYPERESULT_H_
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_TAGGINGIMAGEREQUEST_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_TAGGINGIMAGEREQUEST_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <alibabacloud/core/RpcServiceRequest.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT TaggingImageRequest : public RpcServiceRequest
|
||||
{
|
||||
|
||||
public:
|
||||
TaggingImageRequest();
|
||||
~TaggingImageRequest();
|
||||
|
||||
int getImageType()const;
|
||||
void setImageType(int imageType);
|
||||
std::string getImageURL()const;
|
||||
void setImageURL(const std::string& imageURL);
|
||||
|
||||
private:
|
||||
int imageType_;
|
||||
std::string imageURL_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_TAGGINGIMAGEREQUEST_H_
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef ALIBABACLOUD_IMAGERECOG_MODEL_TAGGINGIMAGERESULT_H_
|
||||
#define ALIBABACLOUD_IMAGERECOG_MODEL_TAGGINGIMAGERESULT_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <alibabacloud/core/ServiceResult.h>
|
||||
#include <alibabacloud/imagerecog/ImagerecogExport.h>
|
||||
|
||||
namespace AlibabaCloud
|
||||
{
|
||||
namespace Imagerecog
|
||||
{
|
||||
namespace Model
|
||||
{
|
||||
class ALIBABACLOUD_IMAGERECOG_EXPORT TaggingImageResult : public ServiceResult
|
||||
{
|
||||
public:
|
||||
struct Data
|
||||
{
|
||||
struct Tag
|
||||
{
|
||||
float confidence;
|
||||
std::string value;
|
||||
};
|
||||
std::vector<Tag> tags;
|
||||
};
|
||||
|
||||
|
||||
TaggingImageResult();
|
||||
explicit TaggingImageResult(const std::string &payload);
|
||||
~TaggingImageResult();
|
||||
Data getData()const;
|
||||
|
||||
protected:
|
||||
void parse(const std::string &payload);
|
||||
private:
|
||||
Data data_;
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !ALIBABACLOUD_IMAGERECOG_MODEL_TAGGINGIMAGERESULT_H_
|
||||
377
imagerecog/src/ImagerecogClient.cc
Normal file
377
imagerecog/src/ImagerecogClient.cc
Normal file
@@ -0,0 +1,377 @@
|
||||
/*
|
||||
* 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/imagerecog/ImagerecogClient.h>
|
||||
#include <alibabacloud/core/SimpleCredentialsProvider.h>
|
||||
|
||||
using namespace AlibabaCloud;
|
||||
using namespace AlibabaCloud::Location;
|
||||
using namespace AlibabaCloud::Imagerecog;
|
||||
using namespace AlibabaCloud::Imagerecog::Model;
|
||||
|
||||
namespace
|
||||
{
|
||||
const std::string SERVICE_NAME = "imagerecog";
|
||||
}
|
||||
|
||||
ImagerecogClient::ImagerecogClient(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, "imagerecog");
|
||||
}
|
||||
|
||||
ImagerecogClient::ImagerecogClient(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, "imagerecog");
|
||||
}
|
||||
|
||||
ImagerecogClient::ImagerecogClient(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, "imagerecog");
|
||||
}
|
||||
|
||||
ImagerecogClient::~ImagerecogClient()
|
||||
{}
|
||||
|
||||
ImagerecogClient::ClassifyingRubbishOutcome ImagerecogClient::classifyingRubbish(const ClassifyingRubbishRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return ClassifyingRubbishOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return ClassifyingRubbishOutcome(ClassifyingRubbishResult(outcome.result()));
|
||||
else
|
||||
return ClassifyingRubbishOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ImagerecogClient::classifyingRubbishAsync(const ClassifyingRubbishRequest& request, const ClassifyingRubbishAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, classifyingRubbish(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ImagerecogClient::ClassifyingRubbishOutcomeCallable ImagerecogClient::classifyingRubbishCallable(const ClassifyingRubbishRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<ClassifyingRubbishOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->classifyingRubbish(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ImagerecogClient::DetectFruitsOutcome ImagerecogClient::detectFruits(const DetectFruitsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DetectFruitsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DetectFruitsOutcome(DetectFruitsResult(outcome.result()));
|
||||
else
|
||||
return DetectFruitsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ImagerecogClient::detectFruitsAsync(const DetectFruitsRequest& request, const DetectFruitsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, detectFruits(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ImagerecogClient::DetectFruitsOutcomeCallable ImagerecogClient::detectFruitsCallable(const DetectFruitsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DetectFruitsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->detectFruits(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ImagerecogClient::DetectImageElementsOutcome ImagerecogClient::detectImageElements(const DetectImageElementsRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return DetectImageElementsOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return DetectImageElementsOutcome(DetectImageElementsResult(outcome.result()));
|
||||
else
|
||||
return DetectImageElementsOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ImagerecogClient::detectImageElementsAsync(const DetectImageElementsRequest& request, const DetectImageElementsAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, detectImageElements(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ImagerecogClient::DetectImageElementsOutcomeCallable ImagerecogClient::detectImageElementsCallable(const DetectImageElementsRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<DetectImageElementsOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->detectImageElements(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ImagerecogClient::RecognizeImageColorOutcome ImagerecogClient::recognizeImageColor(const RecognizeImageColorRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeImageColorOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeImageColorOutcome(RecognizeImageColorResult(outcome.result()));
|
||||
else
|
||||
return RecognizeImageColorOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ImagerecogClient::recognizeImageColorAsync(const RecognizeImageColorRequest& request, const RecognizeImageColorAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeImageColor(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ImagerecogClient::RecognizeImageColorOutcomeCallable ImagerecogClient::recognizeImageColorCallable(const RecognizeImageColorRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeImageColorOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeImageColor(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ImagerecogClient::RecognizeImageStyleOutcome ImagerecogClient::recognizeImageStyle(const RecognizeImageStyleRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeImageStyleOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeImageStyleOutcome(RecognizeImageStyleResult(outcome.result()));
|
||||
else
|
||||
return RecognizeImageStyleOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ImagerecogClient::recognizeImageStyleAsync(const RecognizeImageStyleRequest& request, const RecognizeImageStyleAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeImageStyle(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ImagerecogClient::RecognizeImageStyleOutcomeCallable ImagerecogClient::recognizeImageStyleCallable(const RecognizeImageStyleRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeImageStyleOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeImageStyle(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ImagerecogClient::RecognizeLogoOutcome ImagerecogClient::recognizeLogo(const RecognizeLogoRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeLogoOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeLogoOutcome(RecognizeLogoResult(outcome.result()));
|
||||
else
|
||||
return RecognizeLogoOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ImagerecogClient::recognizeLogoAsync(const RecognizeLogoRequest& request, const RecognizeLogoAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeLogo(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ImagerecogClient::RecognizeLogoOutcomeCallable ImagerecogClient::recognizeLogoCallable(const RecognizeLogoRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeLogoOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeLogo(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ImagerecogClient::RecognizeSceneOutcome ImagerecogClient::recognizeScene(const RecognizeSceneRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeSceneOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeSceneOutcome(RecognizeSceneResult(outcome.result()));
|
||||
else
|
||||
return RecognizeSceneOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ImagerecogClient::recognizeSceneAsync(const RecognizeSceneRequest& request, const RecognizeSceneAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeScene(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ImagerecogClient::RecognizeSceneOutcomeCallable ImagerecogClient::recognizeSceneCallable(const RecognizeSceneRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeSceneOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeScene(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ImagerecogClient::RecognizeVehicleTypeOutcome ImagerecogClient::recognizeVehicleType(const RecognizeVehicleTypeRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return RecognizeVehicleTypeOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return RecognizeVehicleTypeOutcome(RecognizeVehicleTypeResult(outcome.result()));
|
||||
else
|
||||
return RecognizeVehicleTypeOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ImagerecogClient::recognizeVehicleTypeAsync(const RecognizeVehicleTypeRequest& request, const RecognizeVehicleTypeAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, recognizeVehicleType(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ImagerecogClient::RecognizeVehicleTypeOutcomeCallable ImagerecogClient::recognizeVehicleTypeCallable(const RecognizeVehicleTypeRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<RecognizeVehicleTypeOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->recognizeVehicleType(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
ImagerecogClient::TaggingImageOutcome ImagerecogClient::taggingImage(const TaggingImageRequest &request) const
|
||||
{
|
||||
auto endpointOutcome = endpointProvider_->getEndpoint();
|
||||
if (!endpointOutcome.isSuccess())
|
||||
return TaggingImageOutcome(endpointOutcome.error());
|
||||
|
||||
auto outcome = makeRequest(endpointOutcome.result(), request);
|
||||
|
||||
if (outcome.isSuccess())
|
||||
return TaggingImageOutcome(TaggingImageResult(outcome.result()));
|
||||
else
|
||||
return TaggingImageOutcome(outcome.error());
|
||||
}
|
||||
|
||||
void ImagerecogClient::taggingImageAsync(const TaggingImageRequest& request, const TaggingImageAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
|
||||
{
|
||||
auto fn = [this, request, handler, context]()
|
||||
{
|
||||
handler(this, request, taggingImage(request), context);
|
||||
};
|
||||
|
||||
asyncExecute(new Runnable(fn));
|
||||
}
|
||||
|
||||
ImagerecogClient::TaggingImageOutcomeCallable ImagerecogClient::taggingImageCallable(const TaggingImageRequest &request) const
|
||||
{
|
||||
auto task = std::make_shared<std::packaged_task<TaggingImageOutcome()>>(
|
||||
[this, request]()
|
||||
{
|
||||
return this->taggingImage(request);
|
||||
});
|
||||
|
||||
asyncExecute(new Runnable([task]() { (*task)(); }));
|
||||
return task->get_future();
|
||||
}
|
||||
|
||||
40
imagerecog/src/model/ClassifyingRubbishRequest.cc
Normal file
40
imagerecog/src/model/ClassifyingRubbishRequest.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/imagerecog/model/ClassifyingRubbishRequest.h>
|
||||
|
||||
using AlibabaCloud::Imagerecog::Model::ClassifyingRubbishRequest;
|
||||
|
||||
ClassifyingRubbishRequest::ClassifyingRubbishRequest() :
|
||||
RpcServiceRequest("imagerecog", "2019-09-30", "ClassifyingRubbish")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
ClassifyingRubbishRequest::~ClassifyingRubbishRequest()
|
||||
{}
|
||||
|
||||
std::string ClassifyingRubbishRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void ClassifyingRubbishRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
66
imagerecog/src/model/ClassifyingRubbishResult.cc
Normal file
66
imagerecog/src/model/ClassifyingRubbishResult.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/imagerecog/model/ClassifyingRubbishResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Imagerecog;
|
||||
using namespace AlibabaCloud::Imagerecog::Model;
|
||||
|
||||
ClassifyingRubbishResult::ClassifyingRubbishResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
ClassifyingRubbishResult::ClassifyingRubbishResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
ClassifyingRubbishResult::~ClassifyingRubbishResult()
|
||||
{}
|
||||
|
||||
void ClassifyingRubbishResult::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["Sensitive"].isNull())
|
||||
data_.sensitive = dataNode["Sensitive"].asString() == "true";
|
||||
auto allElementsNode = dataNode["Elements"]["Element"];
|
||||
for (auto dataNodeElementsElement : allElementsNode)
|
||||
{
|
||||
Data::Element elementObject;
|
||||
if(!dataNodeElementsElement["Category"].isNull())
|
||||
elementObject.category = dataNodeElementsElement["Category"].asString();
|
||||
if(!dataNodeElementsElement["CategoryScore"].isNull())
|
||||
elementObject.categoryScore = std::stof(dataNodeElementsElement["CategoryScore"].asString());
|
||||
if(!dataNodeElementsElement["Rubbish"].isNull())
|
||||
elementObject.rubbish = dataNodeElementsElement["Rubbish"].asString();
|
||||
if(!dataNodeElementsElement["RubbishScore"].isNull())
|
||||
elementObject.rubbishScore = std::stof(dataNodeElementsElement["RubbishScore"].asString());
|
||||
data_.elements.push_back(elementObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ClassifyingRubbishResult::Data ClassifyingRubbishResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
imagerecog/src/model/DetectFruitsRequest.cc
Normal file
40
imagerecog/src/model/DetectFruitsRequest.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/imagerecog/model/DetectFruitsRequest.h>
|
||||
|
||||
using AlibabaCloud::Imagerecog::Model::DetectFruitsRequest;
|
||||
|
||||
DetectFruitsRequest::DetectFruitsRequest() :
|
||||
RpcServiceRequest("imagerecog", "2019-09-30", "DetectFruits")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DetectFruitsRequest::~DetectFruitsRequest()
|
||||
{}
|
||||
|
||||
std::string DetectFruitsRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void DetectFruitsRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
63
imagerecog/src/model/DetectFruitsResult.cc
Normal file
63
imagerecog/src/model/DetectFruitsResult.cc
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 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/imagerecog/model/DetectFruitsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Imagerecog;
|
||||
using namespace AlibabaCloud::Imagerecog::Model;
|
||||
|
||||
DetectFruitsResult::DetectFruitsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DetectFruitsResult::DetectFruitsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DetectFruitsResult::~DetectFruitsResult()
|
||||
{}
|
||||
|
||||
void DetectFruitsResult::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["Name"].isNull())
|
||||
elementObject.name = dataNodeElementsElement["Name"].asString();
|
||||
if(!dataNodeElementsElement["Score"].isNull())
|
||||
elementObject.score = std::stof(dataNodeElementsElement["Score"].asString());
|
||||
auto allBox = value["Box"]["Box"];
|
||||
for (auto value : allBox)
|
||||
elementObject.box.push_back(value.asString());
|
||||
data_.elements.push_back(elementObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DetectFruitsResult::Data DetectFruitsResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
imagerecog/src/model/DetectImageElementsRequest.cc
Normal file
40
imagerecog/src/model/DetectImageElementsRequest.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/imagerecog/model/DetectImageElementsRequest.h>
|
||||
|
||||
using AlibabaCloud::Imagerecog::Model::DetectImageElementsRequest;
|
||||
|
||||
DetectImageElementsRequest::DetectImageElementsRequest() :
|
||||
RpcServiceRequest("imagerecog", "2019-09-30", "DetectImageElements")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
DetectImageElementsRequest::~DetectImageElementsRequest()
|
||||
{}
|
||||
|
||||
std::string DetectImageElementsRequest::getUrl()const
|
||||
{
|
||||
return url_;
|
||||
}
|
||||
|
||||
void DetectImageElementsRequest::setUrl(const std::string& url)
|
||||
{
|
||||
url_ = url;
|
||||
setBodyParameter("Url", url);
|
||||
}
|
||||
|
||||
68
imagerecog/src/model/DetectImageElementsResult.cc
Normal file
68
imagerecog/src/model/DetectImageElementsResult.cc
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
* 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/imagerecog/model/DetectImageElementsResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Imagerecog;
|
||||
using namespace AlibabaCloud::Imagerecog::Model;
|
||||
|
||||
DetectImageElementsResult::DetectImageElementsResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
DetectImageElementsResult::DetectImageElementsResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
DetectImageElementsResult::~DetectImageElementsResult()
|
||||
{}
|
||||
|
||||
void DetectImageElementsResult::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["Type"].isNull())
|
||||
elementObject.type = dataNodeElementsElement["Type"].asString();
|
||||
if(!dataNodeElementsElement["X"].isNull())
|
||||
elementObject.x = std::stoi(dataNodeElementsElement["X"].asString());
|
||||
if(!dataNodeElementsElement["Y"].isNull())
|
||||
elementObject.y = std::stoi(dataNodeElementsElement["Y"].asString());
|
||||
if(!dataNodeElementsElement["Width"].isNull())
|
||||
elementObject.width = std::stoi(dataNodeElementsElement["Width"].asString());
|
||||
if(!dataNodeElementsElement["Height"].isNull())
|
||||
elementObject.height = std::stoi(dataNodeElementsElement["Height"].asString());
|
||||
if(!dataNodeElementsElement["Score"].isNull())
|
||||
elementObject.score = std::stof(dataNodeElementsElement["Score"].asString());
|
||||
data_.elements.push_back(elementObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
DetectImageElementsResult::Data DetectImageElementsResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
imagerecog/src/model/RecognizeImageColorRequest.cc
Normal file
51
imagerecog/src/model/RecognizeImageColorRequest.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/imagerecog/model/RecognizeImageColorRequest.h>
|
||||
|
||||
using AlibabaCloud::Imagerecog::Model::RecognizeImageColorRequest;
|
||||
|
||||
RecognizeImageColorRequest::RecognizeImageColorRequest() :
|
||||
RpcServiceRequest("imagerecog", "2019-09-30", "RecognizeImageColor")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeImageColorRequest::~RecognizeImageColorRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizeImageColorRequest::getUrl()const
|
||||
{
|
||||
return url_;
|
||||
}
|
||||
|
||||
void RecognizeImageColorRequest::setUrl(const std::string& url)
|
||||
{
|
||||
url_ = url;
|
||||
setBodyParameter("Url", url);
|
||||
}
|
||||
|
||||
int RecognizeImageColorRequest::getColorCount()const
|
||||
{
|
||||
return colorCount_;
|
||||
}
|
||||
|
||||
void RecognizeImageColorRequest::setColorCount(int colorCount)
|
||||
{
|
||||
colorCount_ = colorCount;
|
||||
setBodyParameter("ColorCount", std::to_string(colorCount));
|
||||
}
|
||||
|
||||
62
imagerecog/src/model/RecognizeImageColorResult.cc
Normal file
62
imagerecog/src/model/RecognizeImageColorResult.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/imagerecog/model/RecognizeImageColorResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Imagerecog;
|
||||
using namespace AlibabaCloud::Imagerecog::Model;
|
||||
|
||||
RecognizeImageColorResult::RecognizeImageColorResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeImageColorResult::RecognizeImageColorResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeImageColorResult::~RecognizeImageColorResult()
|
||||
{}
|
||||
|
||||
void RecognizeImageColorResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allColorTemplateListNode = dataNode["ColorTemplateList"]["ColorTemplate"];
|
||||
for (auto dataNodeColorTemplateListColorTemplate : allColorTemplateListNode)
|
||||
{
|
||||
Data::ColorTemplate colorTemplateObject;
|
||||
if(!dataNodeColorTemplateListColorTemplate["Color"].isNull())
|
||||
colorTemplateObject.color = dataNodeColorTemplateListColorTemplate["Color"].asString();
|
||||
if(!dataNodeColorTemplateListColorTemplate["Label"].isNull())
|
||||
colorTemplateObject.label = dataNodeColorTemplateListColorTemplate["Label"].asString();
|
||||
if(!dataNodeColorTemplateListColorTemplate["Percentage"].isNull())
|
||||
colorTemplateObject.percentage = std::stof(dataNodeColorTemplateListColorTemplate["Percentage"].asString());
|
||||
data_.colorTemplateList.push_back(colorTemplateObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RecognizeImageColorResult::Data RecognizeImageColorResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
imagerecog/src/model/RecognizeImageStyleRequest.cc
Normal file
40
imagerecog/src/model/RecognizeImageStyleRequest.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/imagerecog/model/RecognizeImageStyleRequest.h>
|
||||
|
||||
using AlibabaCloud::Imagerecog::Model::RecognizeImageStyleRequest;
|
||||
|
||||
RecognizeImageStyleRequest::RecognizeImageStyleRequest() :
|
||||
RpcServiceRequest("imagerecog", "2019-09-30", "RecognizeImageStyle")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeImageStyleRequest::~RecognizeImageStyleRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizeImageStyleRequest::getUrl()const
|
||||
{
|
||||
return url_;
|
||||
}
|
||||
|
||||
void RecognizeImageStyleRequest::setUrl(const std::string& url)
|
||||
{
|
||||
url_ = url;
|
||||
setBodyParameter("Url", url);
|
||||
}
|
||||
|
||||
53
imagerecog/src/model/RecognizeImageStyleResult.cc
Normal file
53
imagerecog/src/model/RecognizeImageStyleResult.cc
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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/imagerecog/model/RecognizeImageStyleResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Imagerecog;
|
||||
using namespace AlibabaCloud::Imagerecog::Model;
|
||||
|
||||
RecognizeImageStyleResult::RecognizeImageStyleResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeImageStyleResult::RecognizeImageStyleResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeImageStyleResult::~RecognizeImageStyleResult()
|
||||
{}
|
||||
|
||||
void RecognizeImageStyleResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allStyles = dataNode["Styles"]["Style"];
|
||||
for (auto value : allStyles)
|
||||
data_.styles.push_back(value.asString());
|
||||
|
||||
}
|
||||
|
||||
RecognizeImageStyleResult::Data RecognizeImageStyleResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
44
imagerecog/src/model/RecognizeLogoRequest.cc
Normal file
44
imagerecog/src/model/RecognizeLogoRequest.cc
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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/imagerecog/model/RecognizeLogoRequest.h>
|
||||
|
||||
using AlibabaCloud::Imagerecog::Model::RecognizeLogoRequest;
|
||||
|
||||
RecognizeLogoRequest::RecognizeLogoRequest() :
|
||||
RpcServiceRequest("imagerecog", "2019-09-30", "RecognizeLogo")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeLogoRequest::~RecognizeLogoRequest()
|
||||
{}
|
||||
|
||||
std::vector<RecognizeLogoRequest::Tasks> RecognizeLogoRequest::getTasks()const
|
||||
{
|
||||
return tasks_;
|
||||
}
|
||||
|
||||
void RecognizeLogoRequest::setTasks(const std::vector<Tasks>& tasks)
|
||||
{
|
||||
tasks_ = tasks;
|
||||
for(int dep1 = 0; dep1!= tasks.size(); dep1++) {
|
||||
auto tasksObj = tasks.at(dep1);
|
||||
std::string tasksObjStr = "Tasks." + std::to_string(dep1 + 1);
|
||||
setParameter(tasksObjStr + ".ImageURL", tasksObj.imageURL);
|
||||
}
|
||||
}
|
||||
|
||||
90
imagerecog/src/model/RecognizeLogoResult.cc
Normal file
90
imagerecog/src/model/RecognizeLogoResult.cc
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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/imagerecog/model/RecognizeLogoResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Imagerecog;
|
||||
using namespace AlibabaCloud::Imagerecog::Model;
|
||||
|
||||
RecognizeLogoResult::RecognizeLogoResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeLogoResult::RecognizeLogoResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeLogoResult::~RecognizeLogoResult()
|
||||
{}
|
||||
|
||||
void RecognizeLogoResult::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["TaskId"].isNull())
|
||||
elementObject.taskId = dataNodeElementsElement["TaskId"].asString();
|
||||
if(!dataNodeElementsElement["ImageURL"].isNull())
|
||||
elementObject.imageURL = dataNodeElementsElement["ImageURL"].asString();
|
||||
auto allResultsNode = dataNodeElementsElement["Results"]["Result"];
|
||||
for (auto dataNodeElementsElementResultsResult : allResultsNode)
|
||||
{
|
||||
Data::Element::Result resultsObject;
|
||||
if(!dataNodeElementsElementResultsResult["Label"].isNull())
|
||||
resultsObject.label = dataNodeElementsElementResultsResult["Label"].asString();
|
||||
if(!dataNodeElementsElementResultsResult["Suggestion"].isNull())
|
||||
resultsObject.suggestion = dataNodeElementsElementResultsResult["Suggestion"].asString();
|
||||
if(!dataNodeElementsElementResultsResult["Rate"].isNull())
|
||||
resultsObject.rate = std::stof(dataNodeElementsElementResultsResult["Rate"].asString());
|
||||
auto allLogosDataNode = dataNodeElementsElementResultsResult["LogosData"]["LogoData"];
|
||||
for (auto dataNodeElementsElementResultsResultLogosDataLogoData : allLogosDataNode)
|
||||
{
|
||||
Data::Element::Result::LogoData logosDataObject;
|
||||
if(!dataNodeElementsElementResultsResultLogosDataLogoData["Name"].isNull())
|
||||
logosDataObject.name = dataNodeElementsElementResultsResultLogosDataLogoData["Name"].asString();
|
||||
if(!dataNodeElementsElementResultsResultLogosDataLogoData["Type"].isNull())
|
||||
logosDataObject.type = dataNodeElementsElementResultsResultLogosDataLogoData["Type"].asString();
|
||||
if(!dataNodeElementsElementResultsResultLogosDataLogoData["X"].isNull())
|
||||
logosDataObject.x = std::stof(dataNodeElementsElementResultsResultLogosDataLogoData["X"].asString());
|
||||
if(!dataNodeElementsElementResultsResultLogosDataLogoData["Y"].isNull())
|
||||
logosDataObject.y = std::stof(dataNodeElementsElementResultsResultLogosDataLogoData["Y"].asString());
|
||||
if(!dataNodeElementsElementResultsResultLogosDataLogoData["H"].isNull())
|
||||
logosDataObject.h = std::stof(dataNodeElementsElementResultsResultLogosDataLogoData["H"].asString());
|
||||
if(!dataNodeElementsElementResultsResultLogosDataLogoData["W"].isNull())
|
||||
logosDataObject.w = std::stof(dataNodeElementsElementResultsResultLogosDataLogoData["W"].asString());
|
||||
resultsObject.logosData.push_back(logosDataObject);
|
||||
}
|
||||
elementObject.results.push_back(resultsObject);
|
||||
}
|
||||
data_.elements.push_back(elementObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RecognizeLogoResult::Data RecognizeLogoResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
imagerecog/src/model/RecognizeSceneRequest.cc
Normal file
51
imagerecog/src/model/RecognizeSceneRequest.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/imagerecog/model/RecognizeSceneRequest.h>
|
||||
|
||||
using AlibabaCloud::Imagerecog::Model::RecognizeSceneRequest;
|
||||
|
||||
RecognizeSceneRequest::RecognizeSceneRequest() :
|
||||
RpcServiceRequest("imagerecog", "2019-09-30", "RecognizeScene")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeSceneRequest::~RecognizeSceneRequest()
|
||||
{}
|
||||
|
||||
int RecognizeSceneRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void RecognizeSceneRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string RecognizeSceneRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeSceneRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
60
imagerecog/src/model/RecognizeSceneResult.cc
Normal file
60
imagerecog/src/model/RecognizeSceneResult.cc
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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/imagerecog/model/RecognizeSceneResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Imagerecog;
|
||||
using namespace AlibabaCloud::Imagerecog::Model;
|
||||
|
||||
RecognizeSceneResult::RecognizeSceneResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeSceneResult::RecognizeSceneResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeSceneResult::~RecognizeSceneResult()
|
||||
{}
|
||||
|
||||
void RecognizeSceneResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allTagsNode = dataNode["Tags"]["Tag"];
|
||||
for (auto dataNodeTagsTag : allTagsNode)
|
||||
{
|
||||
Data::Tag tagObject;
|
||||
if(!dataNodeTagsTag["Confidence"].isNull())
|
||||
tagObject.confidence = std::stof(dataNodeTagsTag["Confidence"].asString());
|
||||
if(!dataNodeTagsTag["Value"].isNull())
|
||||
tagObject.value = dataNodeTagsTag["Value"].asString();
|
||||
data_.tags.push_back(tagObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RecognizeSceneResult::Data RecognizeSceneResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
40
imagerecog/src/model/RecognizeVehicleTypeRequest.cc
Normal file
40
imagerecog/src/model/RecognizeVehicleTypeRequest.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/imagerecog/model/RecognizeVehicleTypeRequest.h>
|
||||
|
||||
using AlibabaCloud::Imagerecog::Model::RecognizeVehicleTypeRequest;
|
||||
|
||||
RecognizeVehicleTypeRequest::RecognizeVehicleTypeRequest() :
|
||||
RpcServiceRequest("imagerecog", "2019-09-30", "RecognizeVehicleType")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
RecognizeVehicleTypeRequest::~RecognizeVehicleTypeRequest()
|
||||
{}
|
||||
|
||||
std::string RecognizeVehicleTypeRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void RecognizeVehicleTypeRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
62
imagerecog/src/model/RecognizeVehicleTypeResult.cc
Normal file
62
imagerecog/src/model/RecognizeVehicleTypeResult.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/imagerecog/model/RecognizeVehicleTypeResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Imagerecog;
|
||||
using namespace AlibabaCloud::Imagerecog::Model;
|
||||
|
||||
RecognizeVehicleTypeResult::RecognizeVehicleTypeResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
RecognizeVehicleTypeResult::RecognizeVehicleTypeResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
RecognizeVehicleTypeResult::~RecognizeVehicleTypeResult()
|
||||
{}
|
||||
|
||||
void RecognizeVehicleTypeResult::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 allElementsNode = dataNode["Elements"]["Element"];
|
||||
for (auto dataNodeElementsElement : allElementsNode)
|
||||
{
|
||||
Data::Element elementObject;
|
||||
if(!dataNodeElementsElement["Name"].isNull())
|
||||
elementObject.name = dataNodeElementsElement["Name"].asString();
|
||||
if(!dataNodeElementsElement["Score"].isNull())
|
||||
elementObject.score = std::stof(dataNodeElementsElement["Score"].asString());
|
||||
data_.elements.push_back(elementObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
RecognizeVehicleTypeResult::Data RecognizeVehicleTypeResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
51
imagerecog/src/model/TaggingImageRequest.cc
Normal file
51
imagerecog/src/model/TaggingImageRequest.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/imagerecog/model/TaggingImageRequest.h>
|
||||
|
||||
using AlibabaCloud::Imagerecog::Model::TaggingImageRequest;
|
||||
|
||||
TaggingImageRequest::TaggingImageRequest() :
|
||||
RpcServiceRequest("imagerecog", "2019-09-30", "TaggingImage")
|
||||
{
|
||||
setMethod(HttpRequest::Method::Post);
|
||||
}
|
||||
|
||||
TaggingImageRequest::~TaggingImageRequest()
|
||||
{}
|
||||
|
||||
int TaggingImageRequest::getImageType()const
|
||||
{
|
||||
return imageType_;
|
||||
}
|
||||
|
||||
void TaggingImageRequest::setImageType(int imageType)
|
||||
{
|
||||
imageType_ = imageType;
|
||||
setBodyParameter("ImageType", std::to_string(imageType));
|
||||
}
|
||||
|
||||
std::string TaggingImageRequest::getImageURL()const
|
||||
{
|
||||
return imageURL_;
|
||||
}
|
||||
|
||||
void TaggingImageRequest::setImageURL(const std::string& imageURL)
|
||||
{
|
||||
imageURL_ = imageURL;
|
||||
setBodyParameter("ImageURL", imageURL);
|
||||
}
|
||||
|
||||
60
imagerecog/src/model/TaggingImageResult.cc
Normal file
60
imagerecog/src/model/TaggingImageResult.cc
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* 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/imagerecog/model/TaggingImageResult.h>
|
||||
#include <json/json.h>
|
||||
|
||||
using namespace AlibabaCloud::Imagerecog;
|
||||
using namespace AlibabaCloud::Imagerecog::Model;
|
||||
|
||||
TaggingImageResult::TaggingImageResult() :
|
||||
ServiceResult()
|
||||
{}
|
||||
|
||||
TaggingImageResult::TaggingImageResult(const std::string &payload) :
|
||||
ServiceResult()
|
||||
{
|
||||
parse(payload);
|
||||
}
|
||||
|
||||
TaggingImageResult::~TaggingImageResult()
|
||||
{}
|
||||
|
||||
void TaggingImageResult::parse(const std::string &payload)
|
||||
{
|
||||
Json::Reader reader;
|
||||
Json::Value value;
|
||||
reader.parse(payload, value);
|
||||
setRequestId(value["RequestId"].asString());
|
||||
auto dataNode = value["Data"];
|
||||
auto allTagsNode = dataNode["Tags"]["Tag"];
|
||||
for (auto dataNodeTagsTag : allTagsNode)
|
||||
{
|
||||
Data::Tag tagObject;
|
||||
if(!dataNodeTagsTag["Confidence"].isNull())
|
||||
tagObject.confidence = std::stof(dataNodeTagsTag["Confidence"].asString());
|
||||
if(!dataNodeTagsTag["Value"].isNull())
|
||||
tagObject.value = dataNodeTagsTag["Value"].asString();
|
||||
data_.tags.push_back(tagObject);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
TaggingImageResult::Data TaggingImageResult::getData()const
|
||||
{
|
||||
return data_;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user