// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// See docs\c_cxx\README.md on generating the Doxygen documentation from this file
/** \mainpage C & C++ APIs
*
* <h1>C</h1>
*
* ::OrtApi - Click here to go to the structure with all C API functions.
*
* <h1>C++</h1>
*
* ::Ort - Click here to go to the namespace holding all of the C++ wrapper classes
*
* It is a set of header only wrapper classes around the C API. The goal is to turn the C style return value error codes into C++ exceptions, and to
* automate memory management through standard C++ RAII principles.
*
* \addtogroup Global
* ONNX Runtime C API
* @{
*/
#pragma once
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
/** \brief The API version defined in this header
*
* This value is used by some API functions to behave as this version of the header expects.
*/
#define ORT_API_VERSION 12
#ifdef __cplusplus
extern "C" {
#endif
//! @}
// SAL2 Definitions
#ifndef _WIN32
#define _In_
#define _In_z_
#define _In_opt_
#define _In_opt_z_
#define _Out_
#define _Outptr_
#define _Out_opt_
#define _Inout_
#define _Inout_opt_
#define _Frees_ptr_opt_
#define _Ret_maybenull_
#define _Ret_notnull_
#define _Check_return_
#define _Outptr_result_maybenull_
#define _In_reads_(X)
#define _Inout_updates_all_(X)
#define _Out_writes_bytes_all_(X)
#define _Out_writes_all_(X)
#define _Success_(X)
#define _Outptr_result_buffer_maybenull_(X)
#define ORT_ALL_ARGS_NONNULL __attribute__((nonnull))
#else
#include <specstrings.h>
#define ORT_ALL_ARGS_NONNULL
#endif
#ifdef _WIN32
// Define ORT_DLL_IMPORT if your program is dynamically linked to Ort.
// dllexport is not used, we use a .def file.
#ifdef ORT_DLL_IMPORT
#define ORT_EXPORT __declspec(dllimport)
#else
#define ORT_EXPORT
#endif
#define ORT_API_CALL _stdcall
#define ORT_MUST_USE_RESULT
#define ORTCHAR_T wchar_t
#else
// To make symbols visible on macOS/iOS
#ifdef __APPLE__
#define ORT_EXPORT __attribute__((visibility("default")))
#else
#define ORT_EXPORT
#endif
#define ORT_API_CALL
#define ORT_MUST_USE_RESULT __attribute__((warn_unused_result))
#define ORTCHAR_T char
#endif
#ifndef ORT_TSTR
#ifdef _WIN32
#define ORT_TSTR(X) L##X
#else
#define ORT_TSTR(X) X
#endif
#endif
// Any pointer marked with _In_ or _Out_, cannot be NULL.
// Windows users should use unicode paths when possible to bypass the MAX_PATH limitation
// Every pointer marked with _In_ or _Out_, cannot be NULL. Caller should ensure that.
// for ReleaseXXX(...) functions, they can accept NULL pointer.
#ifdef __cplusplus
// For any compiler with C++11 support, MSVC 2015 and greater, or Clang version supporting noexcept.
// Such complex condition is needed because compilers set __cplusplus value differently.
#ifndef __has_feature
#define __has_feature(x) 0
#endif
#if ((__cplusplus >= 201103L) || (_MSC_VER >= 1900) || (defined(__has_feature) && __has_feature(cxx_noexcept)))
#define NO_EXCEPTION noexcept
#else
#define NO_EXCEPTION throw()
#endif
#else
#define NO_EXCEPTION
#endif
// __VA_ARGS__ on Windows and Linux are different
#define ORT_API(RETURN_TYPE, NAME, ...) RETURN_TYPE ORT_API_CALL NAME(__VA_ARGS__) NO_EXCEPTION
#define ORT_API_STATUS(NAME, ...) \
_Success_(return == 0) _Check_return_ _Ret_maybenull_ OrtStatusPtr ORT_API_CALL NAME(__VA_ARGS__) NO_EXCEPTION ORT_MUST_USE_RESULT
// XXX: Unfortunately, SAL annotations are known to not work with function pointers
#define ORT_API2_STATUS(NAME, ...) \
_Check_return_ _Ret_maybenull_ OrtStatusPtr(ORT_API_CALL* NAME)(__VA_ARGS__) NO_EXCEPTION ORT_MUST_USE_RESULT
// Used in *.cc files. Almost as same as ORT_API_STATUS, except without ORT_MUST_USE_RESULT and ORT_EXPORT
#define ORT_API_STATUS_IMPL(NAME, ...) \
GSL_SUPPRESS(r .11) \
_Success_(return == 0) _Check_return_ _Ret_maybenull_ OrtStatusPtr ORT_API_CALL NAME(__VA_ARGS__) NO_EXCEPTION
#define ORT_CLASS_RELEASE(X) void(ORT_API_CALL * Release##X)(_Frees_ptr_opt_ Ort##X * input)
#ifdef __DOXYGEN__
#undef ORT_API_STATUS
#define ORT_API_STATUS(NAME, ...) OrtStatus* NAME(__VA_ARGS__)
#undef ORT_API2_STATUS
#define ORT_API2_STATUS(NAME, ...) OrtStatus* NAME(__VA_ARGS__)
#undef ORT_CLASS_RELEASE
#define ORT_CLASS_RELEASE(X) void Release##X(Ort##X* input)
#undef NO_EXCEPTION
#define NO_EXCEPTION
#endif
/** \addtogroup Global
* ONNX Runtime C API
* @{
*/
/** Copied from TensorProto::DataType
* Currently, Ort doesn't support complex64, complex128
*/
typedef enum ONNXTensorElementDataType {
ONNX_TENSOR_ELEMENT_DATA_TYPE_UNDEFINED,
ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT, // maps to c type float
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT8, // maps to c type uint8_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT8, // maps to c type int8_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT16, // maps to c type uint16_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT16, // maps to c type int16_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT32, // maps to c type int32_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_INT64, // maps to c type int64_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_STRING, // maps to c++ type std::string
ONNX_TENSOR_ELEMENT_DATA_TYPE_BOOL,
ONNX_TENSOR_ELEMENT_DATA_TYPE_FLOAT16,
ONNX_TENSOR_ELEMENT_DATA_TYPE_DOUBLE, // maps to c type double
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT32, // maps to c type uint32_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_UINT64, // maps to c type uint64_t
ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX64, // complex with float32 real and imaginary components
ONNX_TENSOR_ELEMENT_DATA_TYPE_COMPLEX128, // complex with float64 real and imaginary components
ONNX_TENSOR_ELEMENT_DATA_TYPE_BFLOAT16 // Non-IEEE floating-point format based on IEEE754 single-precision
} ONNXTensorElementDataType;
// Synced with onnx TypeProto oneof
typedef enum ONNXType {
ONNX_TYPE_UNKNOWN,
ONNX_TYPE_TENSOR,
ONNX_TYPE_SEQUENCE,
ONNX_TYPE_MAP,
ONNX_TYPE_OPAQUE,
ONNX_TYPE_SPARSETENSOR,
ONNX_TYPE_OPTIONAL
} ONNXType;
// These types are synced with internal
// SparseFormatFlags
typedef enum OrtSparseFormat {
ORT_SPARSE_UNDEFINED = 0,
ORT_SPARSE_COO = 0x1,
ORT_SPARSE_CSRC = 0x2,
ORT_SPARSE_BLOCK_SPARSE = 0x4
} OrtSparseFormat;
// Enum allows to query sparse tensor indices
enum OrtSparseIndicesFormat {
ORT_SPARSE_COO_INDICES,
ORT_SPARSE_CSR_INNER_INDICES,
ORT_SPARSE_CSR_OUTER_INDICES,
ORT_SPARSE_BLOCK_SPARSE_INDICES
};
/** \brief Logging severity levels
*
* In typical API usage, specifying a logging severity level specifies the minimum severity of log messages to show.
*/
typedef enum OrtLoggingLevel {
ORT_LOGGING_LEVEL_VERBOSE, ///< Verbose informational messages (least severe).
ORT_LOGGING_LEVEL_INFO, ///< Informational messages.
ORT_LOGGING_LEVEL_WARNING, ///< Warning messages.
ORT_LOGGING_LEVEL_ERROR, ///< Error messages.
ORT_LOGGING_LEVEL_FATAL, ///< Fatal error messages (most severe).
} OrtLoggingLevel;
typedef enum OrtErrorCode {
ORT_OK,
ORT_FAIL,
ORT_INVALID_ARGUMENT,
ORT_NO_SUCHFILE,
ORT_NO_MODEL,
ORT_ENGINE_ERROR,
ORT_RUNTIME_EXCEPTION,
ORT_INVALID_PROTOBUF,
ORT_MODEL_LOADED,
ORT_NOT_IMPLEMENTED,
ORT_INVALID_GRAPH,
ORT_EP_FAIL,
} OrtErrorCode;
typedef enum OrtOpAttrType {
ORT_OP_ATTR_UNDEFINED = 0,
ORT_OP_ATTR_INT,
ORT_OP_ATTR_INTS,
ORT_OP_ATTR_FLOAT,
ORT_OP_ATTR_FLOATS,
ORT_OP_ATTR_STRING,
ORT_OP_ATTR_STRINGS,
} OrtOpAttrType;
//! @}
#define ORT_RUNTIME_CLASS(X) \
struct Ort##X; \
typedef struct Ort##X Ort##X;
/** \addtogroup Global
* ONNX Runtime C API
* @{
*/
// The actual types defined have an Ort prefix
ORT_RUNTIME_CLASS(Env);
ORT_RUNTIME_CLASS(Status); // nullptr for Status* indicates success
ORT_RUNTIME_CLASS(MemoryInfo);
ORT_RUNTIME_CLASS(IoBinding);
ORT_RUNTIME_CLASS(
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
在夜间雾霾场景中,可见性经常受到低光照、强烈光晕、光散射以及多色光源等多种因素的影响而降低。现有的夜间除雾方法常常难以处理光晕或低光照条件,导致视觉效果过暗或光晕效应无法被有效抑制。本文通过抑制光晕和增强低光区域来提升单张夜间雾霾图像的可见性。为了处理光晕效应,我们提出了一个光源感知网络来检测夜间图像的光源,并采用APSF(大气点扩散函数)引导的光晕渲染。我们的框架在渲染图像上进行训练,实现了光晕的抑制。此外,我们还利用梯度自适应卷积来捕捉雾霾场景中的边缘和纹理。通过提取的边缘和纹理,我们在不丢失重要结构细节的情况下增强了场景的对比度。为了提升低光强度,我们的网络学习了一个注意力图,然后通过伽马校正进行调整。这个注意力图在低光区域有较高的值,在雾霾和光晕区域有较低的值。通过在真实的夜间雾霾图像上进行广泛的评估,我们的方法证明了其有效性。
资源推荐
资源详情
资源评论
收起资源包目录
夜晚图像雾霾图像增强C++/python部署 (621个子文件)
cmd.bat 15B
DeDoDe.cpp 4KB
NighttimeDehaze.cpp 4KB
main.cpp 539B
Browse.VC.db 26.34MB
opencv_world470.dll 43.22MB
onnxruntime.dll 7.87MB
onnxruntime_providers_shared.dll 21KB
DeDoDe.exe 35KB
DeDoDe.vcxproj.filters 1KB
onnxruntime_c_api.h 149KB
core_c.h 126KB
msa_macros.h 81KB
types_c.h 70KB
kmeans_index.h 66KB
onnxruntime_cxx_api.h 62KB
onnxruntime_cxx_inline.h 51KB
imgproc_c.h 50KB
dist.h 40KB
cvdef.h 36KB
constants_c.h 30KB
cv_cpu_helper.h 29KB
hierarchical_clustering_index.h 26KB
autotuned_index.h 21KB
kdtree_single_index.h 20KB
kdtree_index.h 20KB
lsh_table.h 18KB
types_c.h 18KB
lsh_index.h 15KB
result_set.h 15KB
index_testing.h 11KB
highgui_c.h 10KB
any.h 8KB
cv_cpu_dispatch.h 8KB
onnxruntime_session_options_config_keys.h 8KB
hdf5.h 7KB
heap.h 7KB
allocator.h 6KB
all_indices.h 6KB
composite_index.h 6KB
nn_index.h 6KB
saving.h 6KB
simplex_downhill.h 6KB
videoio_c.h 6KB
calib3d_c.h 5KB
cap_ios.h 5KB
interface.h 5KB
dynamic_bitset.h 4KB
defines.h 4KB
random.h 4KB
params.h 4KB
logger.h 4KB
linear_index.h 4KB
cvconfig.h 3KB
ground_truth.h 3KB
matrix.h 3KB
object_factory.h 3KB
sampling.h 3KB
ios.h 3KB
timer.h 3KB
general.h 2KB
config.h 2KB
constants_c.h 2KB
onnxruntime_run_options_config_keys.h 1KB
DeDoDe.h 1KB
interface.h 1KB
NighttimeDehaze.h 951B
macosx.h 731B
interface.h 551B
provider_options.h 498B
constants_c.h 462B
cpu_provider_factory.h 416B
constants_c.h 398B
tensorrt_provider_factory.h 327B
dummy.h 197B
imgcodecs_c.h 145B
imgproc.hpp 241KB
color_detail.hpp 219KB
calib3d.hpp 217KB
mat.hpp 161KB
intrin_avx512.hpp 157KB
core.hpp 151KB
intrin_sse.hpp 132KB
intrin_avx.hpp 131KB
intrin_lasx.hpp 131KB
intrin_wasm.hpp 107KB
intrin_rvv.hpp 104KB
intrin_cpp.hpp 101KB
intrin_rvv071.hpp 98KB
intrin_neon.hpp 96KB
ml.hpp 90KB
intrin_rvv_scalable.hpp 89KB
dnn.hpp 87KB
mat.inl.hpp 87KB
core.hpp 78KB
imgproc.hpp 78KB
types.hpp 71KB
intrin_msa.hpp 71KB
features2d.hpp 71KB
intrin_vsx.hpp 66KB
共 621 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
知来者逆
- 粉丝: 4w+
- 资源: 82
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功