Compute Mean Value of Train and Test Dataset of Caltech-256 dataset in matlab code
Compute Mean Value of Train and Test Dataset of Caltech-256 dataset in matlab code
clc;
imPath = '/home/wangxiao/Downloads/Link to caltech_256_dataset/image_/ori_total_im_/';
imageFiles = dir(imPath);
train_txtFile = '/home/wangxiao/Downloads/caltech256_whole_data_/train_caltech_label.txt';
test_txtFile = '/home/wangxiao/Downloads/caltech256_whole_data_/test_caltech_label.txt';
train_list = importdata(train_txtFile);
test_list = importdata(test_txtFile);
train_R = 0; train_G = 0; train_B = 0;
test_R = 0; test_G = 0; test_B = 0;
for i = 1:size(train_list, 1)
train_im_name = train_list.textdata{i, 1} ;
train_image = imread([imPath, train_im_name]);
train_image = double(train_image);
train_R = train_R + mean(mean( train_image(:, :, 1) ));
train_G = train_G +mean(mean( train_image(:, :, 2) ));
train_B = train_B + mean(mean( train_image(:, :, 3) ));
end
for i = 1:size(test_list, 1)
test_im_name = test_list.textdata{i, 1} ;
test_image = imread([imPath, test_im_name]);
% imshow(test_image);
test_image = double(test_image);
test_R = test_R +mean(mean( test_image(:, :, 1) )) ;
test_G = test_G +mean(mean( test_image(:, :, 2) )) ;
test_B = test_B +mean(mean( test_image(:, :, 3) )) ;
end
mean_train_R = train_R / size(train_list, 1);
mean_train_G = train_G / size(train_list, 1);
mean_train_B = train_B / size(train_list, 1);
mean_test_R = test_R / size(test_list, 1);
mean_test_G = test_G / size(test_list, 1);
mean_test_B = test_B / size(test_list, 1);
Compute Mean Value of Train and Test Dataset of Caltech-256 dataset in matlab code的更多相关文章
- Matlab Code for Visualize the Tracking Results of OTB100 dataset
Matlab Code for Visualize the Tracking Results of OTB100 dataset 2018-11-12 17:06:21 %把所有tracker的结果画 ...
- 判断dataset是否被修改—DataSet.HasChanges 方法
DataSet.HasChanges 方法 获取一个值,该值指示 DataSet 是否有更改,包括新增行.已删除的行或已修改的行. 命名空间: System.Data程序集: System.Da ...
- DataSet 取值,DataSet行数,DataSet列数 从DataSet中取出特定值
1 DataSet.Table[0].Rows[ i ][ j ] 其中i 代表第 i 行数, j 代表第 j 列数 2 DataSet.Table[0].Rows[ i ].ItemArray[ j ...
- Debugger DataSet 调试时查看DataSet
delphi 跟踪调试的时候查看DataSet数据记录 Ctrl+F7调试 增强工具DataSethttp://edn.embarcadero.com/article/40268 http://do ...
- [TensorFlow 团队] TensorFlow 数据集和估算器介绍
发布人:TensorFlow 团队 原文链接:http://developers.googleblog.cn/2017/09/tensorflow.html TensorFlow 1.3 引入了两个重 ...
- [TensorFlow] Introduction to TensorFlow Datasets and Estimators
Datasets and Estimators are two key TensorFlow features you should use: Datasets: The best practice ...
- TensorFlow高层封装:从入门到喷这本书
目录 TensorFlow高层封装:从入门到喷这本书 0. 写在前面 1. TensorFlow高层封装总览 2. Keras介绍 2.1 Keras基本用法 2.2 Keras高级用法 3. Est ...
- deeplearning 源码收集
Theano – CPU/GPU symbolic expression compiler in python (from MILA lab at University of Montreal) To ...
- [Tensorflow] 使用 tf.train.Checkpoint() 保存 / 加载 keras subclassed model
在 subclassed_model.py 中,通过对 tf.keras.Model 进行子类化,设计了两个自定义模型. import tensorflow as tf tf.enable_eager ...
随机推荐
- winform错误提示 :窗口类名无效(Window class name is not valid)
winfrom 程序在 xp 操作系统上报错提示 窗口类名无效(Window class name is not valid) 解决方法 注释 Program类 里 这句 Application.En ...
- python解无忧公主的数学时间097.py
python解无忧公主的数学时间097.py """ python解无忧公主的数学时间097.py codegay 2016年3月30日 00:17:26 http:// ...
- PHP time() 函数
定义和用法 time() 函数返回当前时间的 Unix 时间戳. 语法 time(void) 参数 描述 void 可选. 说明 返回自从 Unix 纪元(格林威治时间 1970 年 1 月 1 日 ...
- ios创建bundle的图片资源文件(转)
在ios开发中为了方便管理资源文件,可以使用bundle的方式来进行管理,比如kkgridview里就是把所需的图片文件全部放在一个bundle来管理的 . 切记目前iOS中只允许使用bundle管理 ...
- yii2 生成PDF格式的文件
1 .先把mpdf-development.zip解压的类文件夹放到vendor目录里面,重命名为mpdf 2 .在vendor/composer/autoload_namespaces.php里面添 ...
- python基础之模块之os模块
os模块 os模块的作用: os,语义为操作系统,所以肯定就是操作系统相关的功能了,可以处理文件和目录这些我们日常手动需要做的操作,就比如说:显示当前目录下所有文件/删除某个文件/获取文件大小…… 另 ...
- 数组Mex
题目描述 请设计一个高效算法,查找数组中未出现的最小正整数. 给定一个整数数组A和数组的大小n,请返回数组中未出现的最小正整数.保证数组大小小于等于500. 测试样例: [-1,2,3,4],4 返回 ...
- iOS数据持久化
在iOS中,实现数据持久化一般分为4大种: 1.属性列表 2.对象归档 3.SQLite 4.Core Data 一.属性列表 NSUserDefaults类的使用和NSKeyedArchiver有很 ...
- PHP Mail 简介
PHP mail() 函数用于从脚本中发送电子邮件. mail(to,subject,message,headers,parameters): 参数 描述 to 必需.规定 email 接收者. su ...
- myEclipse使用有感
一.破解 使用myeclipse 10.0版本:然后破解:(之前我使用10.7破解成功了,但是发布有问题) 二.发布注意事项 1.清理发布目录, 不要有多个项目搅和 2.js相关, 注意清理浏览器缓存 ...