// Copyright 2015 Google Inc. 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 TENSORFLOW_CONTRIB_IOS_EXAMPLES_CAMERA_TENSORFLOW_UTILS_H_
#define TENSORFLOW_CONTRIB_IOS_EXAMPLES_CAMERA_TENSORFLOW_UTILS_H_
#include <memory>
#include <vector>
#include "tensorflow/core/public/session.h"
#include "tensorflow/core/util/memmapped_file_system.h"
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
// Reads a serialized GraphDef protobuf file from the bundle, typically
// created with the freeze_graph script. Populates the session argument with a
// Session object that has the model loaded.
tensorflow::Status LoadModel(NSString* file_name, NSString* file_type,
std::unique_ptr<tensorflow::Session>* session);
// Loads a model from a file that has been created using the
// convert_graphdef_memmapped_format tool. This bundles together a GraphDef
// proto together with a file that can be memory-mapped, containing the weight
// parameters for the model. This is useful because it reduces the overall
// memory pressure, since the read-only parameter regions can be easily paged
// out and don't count toward memory limits on iOS.
tensorflow::Status LoadMemoryMappedModel(
NSString* file_name, NSString* file_type,
std::unique_ptr<tensorflow::Session>* session,
std::unique_ptr<tensorflow::MemmappedEnv>* memmapped_env);
// Takes a text file with a single label on each line, and returns a list.
tensorflow::Status LoadLabels(NSString* file_name, NSString* file_type,
std::vector<std::string>* label_strings);
// Sorts the results from a model execution, and returns the highest scoring.
void GetTopN(const Eigen::TensorMap<Eigen::Tensor<float, 1, Eigen::RowMajor>,
Eigen::Aligned>& prediction,
const int num_results, const float threshold,
std::vector<std::pair<float, int> >* top_results);
#endif // TENSORFLOW_CONTRIB_IOS_EXAMPLES_CAMERA_TENSORFLOW_UTILS_H_
没有合适的资源?快使用搜索试试~ 我知道了~
基于Tensorflow的iOS图像处理工程,效果类似Primsa.zip
共142个文件
plist:15个
m:14个
h:9个
0 下载量 114 浏览量
2024-03-28
18:04:32
上传
评论
收藏 57.32MB ZIP 举报
温馨提示
人工智能-深度学习-tensorflow
资源推荐
资源详情
资源评论
收起资源包目录
基于Tensorflow的iOS图像处理工程,效果类似Primsa.zip (142个子文件)
checkpoint 249B
multistyle-pastiche-generator-varied.ckpt 6.79MB
multistyle-pastiche-generator-varied.ckpt-1.data-00000-of-00001 6.78MB
tensorflow_utils.h 2KB
StyleModel.h 1KB
SlimMPSCNN.h 934B
HomeViewController.h 664B
HomeViewController.h 511B
HomeViewController.h 511B
AppDelegate.h 272B
AppDelegate.h 272B
AppDelegate.h 272B
scripts.iml 398B
multistyle-pastiche-generator-varied.ckpt-1.index 2KB
sample.jpg 53KB
Contents.json 1KB
Contents.json 1KB
Contents.json 1KB
StyleModel.m 24KB
SlimMPSCNN.m 6KB
AppDelegate.m 2KB
AppDelegate.m 2KB
AppDelegate.m 2KB
PrismaUITests.m 1KB
PrismaUITests.m 1KB
PrismaUITests.m 1KB
PrismaTests.m 891B
PrismaTests.m 891B
PrismaTests.m 891B
main.m 329B
main.m 329B
main.m 329B
multistyle-pastiche-generator-varied.ckpt-1.meta 7.11MB
stylize.mlmodel 6.93MB
HomeViewController.mm 10KB
HomeViewController.mm 9KB
HomeViewController.mm 8KB
tensorflow_utils.mm 8KB
rounded_graph.pb 7.04MB
rounded_graph.pb 7.04MB
frozen.pb 6.93MB
inference.pb 6.92MB
stylize_quantized.pb 551KB
input.pb 499KB
project.pbxproj 52KB
project.pbxproj 25KB
project.pbxproj 22KB
Info.plist 2KB
Info.plist 2KB
Info.plist 2KB
Info.plist 680B
Info.plist 680B
Info.plist 680B
Info.plist 680B
Info.plist 680B
Info.plist 680B
xcschememanagement.plist 658B
xcschememanagement.plist 658B
xcschememanagement.plist 658B
IDEWorkspaceChecks.plist 238B
IDEWorkspaceChecks.plist 238B
IDEWorkspaceChecks.plist 238B
image_utils.py 22KB
ops.py 9KB
model.py 5KB
transformImage.py 5KB
imagenet_data.py 4KB
TF2CoreML.py 2KB
image_utils.pyc 19KB
ops.pyc 7KB
model.pyc 5KB
imagenet_data.pyc 4KB
bazel.sh 1KB
Main.storyboard 9KB
Main.storyboard 9KB
Main.storyboard 8KB
LaunchScreen.storyboard 2KB
LaunchScreen.storyboard 2KB
LaunchScreen.storyboard 2KB
transformer_contract_conv1_InstanceNorm_beta 4KB
transformer_contract_conv1_InstanceNorm_gamma 4KB
transformer_contract_conv1_weights 30KB
transformer_contract_conv2_InstanceNorm_beta 8KB
transformer_contract_conv2_InstanceNorm_gamma 8KB
transformer_contract_conv2_weights 72KB
transformer_contract_conv3_InstanceNorm_beta 16KB
transformer_contract_conv3_InstanceNorm_gamma 16KB
transformer_contract_conv3_weights 288KB
transformer_expand_conv1_conv_InstanceNorm_beta 8KB
transformer_expand_conv1_conv_InstanceNorm_gamma 8KB
transformer_expand_conv1_conv_weights 288KB
transformer_expand_conv2_conv_InstanceNorm_beta 4KB
transformer_expand_conv2_conv_InstanceNorm_gamma 4KB
transformer_expand_conv2_conv_weights 72KB
transformer_expand_conv3_conv_InstanceNorm_beta 384B
transformer_expand_conv3_conv_InstanceNorm_gamma 384B
transformer_expand_conv3_conv_weights 30KB
transformer_residual_residual1_conv1_InstanceNorm_beta 16KB
transformer_residual_residual1_conv1_InstanceNorm_gamma 16KB
transformer_residual_residual1_conv1_weights 576KB
共 142 条
- 1
- 2
资源评论
博士僧小星
- 粉丝: 1746
- 资源: 5850
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功