#include "mediapipe/tasks/cc/core/model_resources_cache.h"
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "absl/container/flat_hash_map.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "absl/strings/substitute.h"
#include "mediapipe/framework/api2/packet.h"
#include "mediapipe/tasks/cc/common.h"
#include "mediapipe/tasks/cc/core/model_asset_bundle_resources.h"
#include "mediapipe/tasks/cc/core/model_resources.h"
#include "tensorflow/lite/core/api/op_resolver.h"
namespace mediapipe {
namespace tasks {
namespace core {
ModelResourcesCache::ModelResourcesCache(
std::unique_ptr<tflite::OpResolver> graph_op_resolver) { … }
bool ModelResourcesCache::Exists(const std::string& tag) const { … }
bool ModelResourcesCache::ModelAssetBundleExists(const std::string& tag) const { … }
absl::Status ModelResourcesCache::AddModelResources(
std::unique_ptr<ModelResources> model_resources) { … }
absl::Status ModelResourcesCache::AddModelResourcesCollection(
std::vector<std::unique_ptr<ModelResources>>& model_resources_collection) { … }
absl::StatusOr<const ModelResources*> ModelResourcesCache::GetModelResources(
const std::string& tag) const { … }
absl::Status ModelResourcesCache::AddModelAssetBundleResources(
std::unique_ptr<ModelAssetBundleResources> model_asset_bundle_resources) { … }
absl::Status ModelResourcesCache::AddModelAssetBundleResourcesCollection(
std::vector<std::unique_ptr<ModelAssetBundleResources>>&
model_asset_bundle_resources_collection) { … }
absl::StatusOr<const ModelAssetBundleResources*>
ModelResourcesCache::GetModelAssetBundleResources(
const std::string& tag) const { … }
absl::StatusOr<api2::Packet<tflite::OpResolver>>
ModelResourcesCache::GetGraphOpResolverPacket() const { … }
}
}
}