mirror of
https://github.com/open-mmlab/mmdeploy.git
synced 2025-01-14 08:09:43 +08:00
* refactor SDK registry * fix lint * decouple transform logic and operations * data management * improve data management * improve data management * context management * fix ResizeOCR * fix operation fallback logic * fix MSVC build * clean-up * sync master * fix lint * Normalize - add `to_float`, merge `cvtcolor` operations * fix macOS build * rename * cleanup * fix lint * fix macOS build * fix MSVC build * support elena * fix * fix * optimize normalize * fix * fix MSVC build * simplify * profiler * use `throw_exception` * misc * fix typo
32 lines
851 B
C++
32 lines
851 B
C++
// Copyright (c) OpenMMLab. All rights reserved.
|
|
|
|
#ifndef MMDEPLOY_TEST_TRANSFORM_UTILS_H
|
|
#define MMDEPLOY_TEST_TRANSFORM_UTILS_H
|
|
|
|
#include "mmdeploy/core/tensor.h"
|
|
#include "mmdeploy/core/value.h"
|
|
#include "mmdeploy/preprocess/transform/transform.h"
|
|
|
|
namespace mmdeploy::test {
|
|
|
|
class Transform {
|
|
public:
|
|
explicit Transform(std::unique_ptr<transform::Transform> transform);
|
|
Result<Value> Process(const Value& input);
|
|
|
|
private:
|
|
Device device_;
|
|
Stream stream_;
|
|
std::unique_ptr<transform::Transform> transform_;
|
|
};
|
|
|
|
std::unique_ptr<Transform> CreateTransform(const Value& cfg, Device device, Stream stream);
|
|
|
|
std::vector<int64_t> Shape(const Value& value, const std::string& shape_key);
|
|
|
|
std::vector<float> ImageNormCfg(const Value& value, const std::string& key);
|
|
|
|
} // namespace mmdeploy::test
|
|
|
|
#endif // MMDEPLOY_TEST_TRANSFORM_UTILS_H
|