├── DenseFuse.model ├── Figs ├── dataset.png ├── motivation.png └── motivation2.png ├── LICENSE ├── MANIFEST.in ├── README.md ├── __pycache__ ├── args_fusion.cpython-36.pyc ├── args_fusion.cpython-37.pyc ├── args_fusion.cpython-38.pyc ├── densefuseNet.cpython-37.pyc ├── densefuseNet.cpython-38.pyc ├── fusion_strategy.cpython-36.pyc ├── fusion_strategy.cpython-37.pyc ├── fusion_strategy.cpython-38.pyc ├── net.cpython-36.pyc ├── net.cpython-37.pyc ├── net.cpython-38.pyc ├── net_visualization.cpython-37.pyc ├── testMat.cpython-36.pyc ├── testMat.cpython-37.pyc ├── testMat.cpython-38.pyc ├── utils.cpython-36.pyc ├── utils.cpython-37.pyc └── utils.cpython-38.pyc ├── args_fusion.py ├── clip ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-37.pyc │ ├── __init__.cpython-38.pyc │ ├── clip.cpython-37.pyc │ ├── clip.cpython-38.pyc │ ├── model.cpython-37.pyc │ ├── model.cpython-38.pyc │ ├── simple_tokenizer.cpython-37.pyc │ └── simple_tokenizer.cpython-38.pyc ├── bpe_simple_vocab_16e6.txt.gz ├── clip.py ├── model.py └── simple_tokenizer.py ├── data ├── country211.md ├── prompts.md ├── rendered-sst2.md └── yfcc100m.md ├── densefuseNet.py ├── docker_stderror ├── fusion_strategy.py ├── genMat.py ├── hubconf.py ├── main_test_gray_ir.py ├── main_test_rgb_ir.py ├── main_trainTextFusion.py ├── models └── LLVIP_pretrained.model ├── net.py ├── notebooks ├── Interacting_with_CLIP.ipynb └── Prompt_Engineering_for_ImageNet.ipynb ├── output ├── fused.jpg └── fused_gray.jpg ├── pytorch_msssim ├── __init__.py └── __pycache__ │ ├── __init__.cpython-36.pyc │ ├── __init__.cpython-37.pyc │ └── __init__.cpython-38.pyc ├── samples ├── description.txt ├── ir.png └── vis.png ├── setup.py ├── testMat.py ├── textual_attention_metrics ├── IVT_LLVIP_test250_textConfidence.mat ├── IVT_RoadScene50_textConfidence.mat ├── IVT_TNO_test30_textConfidence.mat ├── IVT_test_TNO │ ├── ir │ │ ├── 1.png │ │ └── 2.png │ └── vis │ │ ├── 1.png │ │ └── 2.png ├── README.md ├── VIF │ ├── 1.bmp │ ├── 2.bmp │ ├── VIF │ │ ├── VIF_test.m │ │ ├── buildSpyr.m │ │ ├── ind2wtree.m │ │ ├── readme.txt │ │ ├── refparams_vecgsm.m │ │ ├── vifsub_est_M.m │ │ └── vifvec.m │ ├── VIF_test.m │ ├── f.bmp │ ├── loe100x100.m │ ├── matlabPyrTools-master │ │ ├── ChangeLog │ │ ├── Contents.m │ │ ├── MEX │ │ │ ├── -MacReadMe │ │ │ ├── compilePyrTools.m │ │ │ ├── convolve.c │ │ │ ├── convolve.h │ │ │ ├── corrDn.c │ │ │ ├── corrDn.mexa64 │ │ │ ├── corrDn.mexglx │ │ │ ├── corrDn.mexmac │ │ │ ├── corrDn.mexmaci │ │ │ ├── corrDn.mexmaci64 │ │ │ ├── corrDn.mexw32 │ │ │ ├── edges-orig.c │ │ │ ├── edges.c │ │ │ ├── histo.c │ │ │ ├── histo.mexa64 │ │ │ ├── histo.mexglx │ │ │ ├── histo.mexmac │ │ │ ├── histo.mexmaci │ │ │ ├── histo.mexmaci64 │ │ │ ├── histo.mexw32 │ │ │ ├── innerProd.c │ │ │ ├── pointOp.c │ │ │ ├── pointOp.mexa64 │ │ │ ├── pointOp.mexglx │ │ │ ├── pointOp.mexmac │ │ │ ├── pointOp.mexmaci │ │ │ ├── pointOp.mexmaci64 │ │ │ ├── pointOp.mexw32 │ │ │ ├── range2.c │ │ │ ├── range2.mexa64 │ │ │ ├── range2.mexglx │ │ │ ├── range2.mexmac │ │ │ ├── range2.mexmaci │ │ │ ├── range2.mexmaci64 │ │ │ ├── range2.mexw32 │ │ │ ├── upConv.c │ │ │ ├── upConv.mexa64 │ │ │ ├── upConv.mexglx │ │ │ ├── upConv.mexmac │ │ │ ├── upConv.mexmaci │ │ │ ├── upConv.mexmaci64 │ │ │ ├── upConv.mexw32 │ │ │ └── wrap.c │ │ ├── README │ │ ├── TUTORIALS │ │ │ ├── HTML │ │ │ │ ├── lcv.css │ │ │ │ ├── matlabPyrTools.png │ │ │ │ ├── matlabPyrTools_0.1.png │ │ │ │ ├── matlabPyrTools_0.2.png │ │ │ │ ├── matlabPyrTools_0.3.png │ │ │ │ ├── matlabPyrTools_01.png │ │ │ │ ├── matlabPyrTools_02.png │ │ │ │ ├── matlabPyrTools_03.png │ │ │ │ ├── matlabPyrTools_04.png │ │ │ │ ├── matlabPyrTools_05.png │ │ │ │ ├── matlabPyrTools_06.png │ │ │ │ ├── matlabPyrTools_07.png │ │ │ │ ├── matlabPyrTools_08.png │ │ │ │ ├── matlabPyrTools_09.png │ │ │ │ ├── matlabPyrTools_10.png │ │ │ │ ├── matlabPyrTools_11.png │ │ │ │ ├── matlabPyrTools_12.png │ │ │ │ ├── matlabPyrTools_13.png │ │ │ │ ├── matlabPyrTools_14.png │ │ │ │ ├── matlabPyrTools_15.png │ │ │ │ ├── matlabPyrTools_16.png │ │ │ │ ├── matlabPyrTools_17.png │ │ │ │ ├── matlabPyrTools_18.png │ │ │ │ ├── matlabPyrTools_19.png │ │ │ │ ├── matlabPyrTools_20.png │ │ │ │ ├── matlabPyrTools_21.png │ │ │ │ ├── matlabPyrTools_22.png │ │ │ │ ├── matlabPyrTools_23.png │ │ │ │ ├── matlabPyrTools_24.png │ │ │ │ ├── pyramids.png │ │ │ │ ├── pyramids_01.png │ │ │ │ ├── pyramids_02.png │ │ │ │ ├── pyramids_03.png │ │ │ │ ├── pyramids_04.png │ │ │ │ ├── pyramids_05.png │ │ │ │ ├── pyramids_06.png │ │ │ │ ├── pyramids_07.png │ │ │ │ ├── pyramids_08.png │ │ │ │ ├── pyramids_09.png │ │ │ │ ├── pyramids_10.png │ │ │ │ ├── pyramids_11.5.png │ │ │ │ ├── pyramids_11.png │ │ │ │ ├── pyramids_12.png │ │ │ │ ├── pyramids_13.png │ │ │ │ ├── pyramids_14.png │ │ │ │ ├── pyramids_15.png │ │ │ │ ├── pyramids_16.png │ │ │ │ ├── pyramids_17.png │ │ │ │ ├── pyramids_18.png │ │ │ │ ├── pyramids_19.png │ │ │ │ ├── pyramids_20.png │ │ │ │ ├── pyramids_21.png │ │ │ │ ├── pyramids_22.png │ │ │ │ ├── pyramids_23.png │ │ │ │ ├── pyramids_24.png │ │ │ │ ├── pyramids_25.png │ │ │ │ ├── pyramids_26.png │ │ │ │ ├── pyramids_27.png │ │ │ │ ├── pyramids_28.5.png │ │ │ │ ├── pyramids_28.png │ │ │ │ ├── pyramids_29.png │ │ │ │ ├── pyramids_30.png │ │ │ │ ├── pyramids_31.png │ │ │ │ ├── pyramids_32.png │ │ │ │ ├── pyramids_33.png │ │ │ │ ├── pyramids_34.png │ │ │ │ ├── pyramids_35.png │ │ │ │ ├── pyramids_36.5.png │ │ │ │ ├── pyramids_36.png │ │ │ │ ├── pyramids_37.3.png │ │ │ │ ├── pyramids_37.6.png │ │ │ │ ├── pyramids_37.png │ │ │ │ ├── pyramids_38.5.png │ │ │ │ ├── pyramids_38.png │ │ │ │ ├── pyramids_39.5.png │ │ │ │ ├── pyramids_39.png │ │ │ │ ├── pyramids_40.png │ │ │ │ ├── pyramids_41.png │ │ │ │ ├── pyramids_42.png │ │ │ │ ├── pyramids_43.png │ │ │ │ ├── pyramids_44.png │ │ │ │ ├── pyramids_45.png │ │ │ │ ├── pyramids_46.png │ │ │ │ ├── pyramids_47.png │ │ │ │ ├── pyramids_48.png │ │ │ │ ├── pyramids_49.png │ │ │ │ ├── pyramids_5.5.png │ │ │ │ ├── pyramids_50.png │ │ │ │ ├── pyramids_51.png │ │ │ │ ├── pyramids_52.5.png │ │ │ │ ├── pyramids_52.png │ │ │ │ ├── pyramids_53.png │ │ │ │ ├── pyramids_54.png │ │ │ │ ├── pyramids_55.png │ │ │ │ ├── pyramids_56.png │ │ │ │ ├── pyramids_57.png │ │ │ │ ├── pyramids_58.png │ │ │ │ ├── pyramids_59.png │ │ │ │ ├── pyramids_60.png │ │ │ │ ├── pyramids_61.png │ │ │ │ ├── pyramids_62.png │ │ │ │ ├── pyramids_63.png │ │ │ │ ├── pyramids_64.png │ │ │ │ ├── pyramids_65.png │ │ │ │ ├── pyramids_66.png │ │ │ │ ├── pyramids_67.png │ │ │ │ ├── pyramids_68.png │ │ │ │ ├── pyramids_69.png │ │ │ │ ├── pyramids_70.png │ │ │ │ ├── pyramids_71.png │ │ │ │ ├── pyramids_72.png │ │ │ │ ├── pyramids_73.png │ │ │ │ ├── pyramids_74.png │ │ │ │ └── pyramids_75.png │ │ │ ├── README │ │ │ ├── matlabPyrTools.html │ │ │ ├── matlabPyrTools.m │ │ │ ├── pyramids.html │ │ │ └── pyramids.m │ │ ├── binomialFilter.m │ │ ├── blur.m │ │ ├── blurDn.m │ │ ├── buildGpyr.m │ │ ├── buildLpyr.m │ │ ├── buildSCFpyr.m │ │ ├── buildSCFpyrLevs.m │ │ ├── buildSFpyr.m │ │ ├── buildSFpyrLevs.m │ │ ├── buildSpyr.m │ │ ├── buildSpyrLevs.m │ │ ├── buildWpyr.m │ │ ├── cconv2.m │ │ ├── clip.m │ │ ├── corrDn.m │ │ ├── corrDn.mexa64 │ │ ├── corrDn.mexglx │ │ ├── corrDn.mexmac │ │ ├── corrDn.mexmaci64 │ │ ├── corrDn.mexw32 │ │ ├── einstein.pgm │ │ ├── entropy2.m │ │ ├── factorial.m │ │ ├── feynman.pgm │ │ ├── histo.m │ │ ├── histo.mexa64 │ │ ├── histo.mexglx │ │ ├── histo.mexmac │ │ ├── histo.mexmaci64 │ │ ├── histo.mexw32 │ │ ├── histoMatch.m │ │ ├── imGradient.m │ │ ├── imStats.m │ │ ├── ind2wtree.m │ │ ├── innerProd.m │ │ ├── kurt2.m │ │ ├── lplot.m │ │ ├── lpyrHt.m │ │ ├── make-tar-file │ │ ├── maxPyrHt.m │ │ ├── mean2.m │ │ ├── mkAngle.m │ │ ├── mkAngularSine.m │ │ ├── mkDisc.m │ │ ├── mkFract.m │ │ ├── mkGaussian.m │ │ ├── mkImpulse.m │ │ ├── mkR.m │ │ ├── mkRamp.m │ │ ├── mkSine.m │ │ ├── mkSquare.m │ │ ├── mkZonePlate.m │ │ ├── modulateFlip.m │ │ ├── namedFilter.m │ │ ├── nextFig.m │ │ ├── pgmRead.m │ │ ├── pgmWrite.m │ │ ├── pixelAxes.m │ │ ├── pointOp.m │ │ ├── pointOp.mexa64 │ │ ├── pointOp.mexglx │ │ ├── pointOp.mexmac │ │ ├── pointOp.mexmaci64 │ │ ├── pointOp.mexw32 │ │ ├── pwd2path.m │ │ ├── pyrBand.m │ │ ├── pyrBandIndices.m │ │ ├── pyrLow.m │ │ ├── pyrTools.pdf │ │ ├── range2.m │ │ ├── range2.mexa64 │ │ ├── range2.mexglx │ │ ├── range2.mexmac │ │ ├── range2.mexmaci64 │ │ ├── range2.mexw32 │ │ ├── rconv2.m │ │ ├── rcosFn.m │ │ ├── readme.txt │ │ ├── reconLpyr.m │ │ ├── reconSCFpyr.m │ │ ├── reconSFpyr.m │ │ ├── reconSFpyrLevs.m │ │ ├── reconSpyr.m │ │ ├── reconSpyrLevs.m │ │ ├── reconWpyr.m │ │ ├── refparams_vecgsm.m │ │ ├── setPyrBand.m │ │ ├── shift.m │ │ ├── showIm.m │ │ ├── showLpyr.m │ │ ├── showSpyr.m │ │ ├── showWpyr.m │ │ ├── skew2.m │ │ ├── sp0Filters.m │ │ ├── sp1Filters.m │ │ ├── sp3Filters.m │ │ ├── sp5Filters.m │ │ ├── spyrBand.m │ │ ├── spyrHigh.m │ │ ├── spyrHt.m │ │ ├── spyrLev.m │ │ ├── spyrNumBands.m │ │ ├── steer.m │ │ ├── steer2HarmMtx.m │ │ ├── subMtx.m │ │ ├── upBlur.m │ │ ├── upConv.m │ │ ├── upConv.mexa64 │ │ ├── upConv.mexglx │ │ ├── upConv.mexmac │ │ ├── upConv.mexmaci64 │ │ ├── upConv.mexw32 │ │ ├── var2.m │ │ ├── vectify.m │ │ ├── vifsub_est_M.m │ │ ├── vifvec.m │ │ ├── wpyrBand.m │ │ ├── wpyrHt.m │ │ ├── wpyrLev.m │ │ └── zconv2.m │ ├── test.m │ └── vif.m ├── analysis_Qabf.m ├── analysis_Qabf_improved.m ├── analysis_ssim.m ├── analysis_ssim_improved.m ├── evaluation_improved.m ├── evaluation_original.m ├── main_evaluation.m ├── outputs_TextFusion_TNO30 │ ├── 1.jpg │ ├── 2.jpg │ └── Average_textual_TextFusion.xlsx └── reference_text_guided_images │ ├── TNO_test30 │ ├── fuse1.jpg │ └── fuse2.jpg │ └── link_for_all_images.txt └── utils.py /DenseFuse.model: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/DenseFuse.model -------------------------------------------------------------------------------- /Figs/dataset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/Figs/dataset.png -------------------------------------------------------------------------------- /Figs/motivation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/Figs/motivation.png -------------------------------------------------------------------------------- /Figs/motivation2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/Figs/motivation2.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 OpenAI 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include clip/bpe_simple_vocab_16e6.txt.gz 2 | -------------------------------------------------------------------------------- /__pycache__/args_fusion.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/args_fusion.cpython-36.pyc -------------------------------------------------------------------------------- /__pycache__/args_fusion.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/args_fusion.cpython-37.pyc -------------------------------------------------------------------------------- /__pycache__/args_fusion.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/args_fusion.cpython-38.pyc -------------------------------------------------------------------------------- /__pycache__/densefuseNet.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/densefuseNet.cpython-37.pyc -------------------------------------------------------------------------------- /__pycache__/densefuseNet.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/densefuseNet.cpython-38.pyc -------------------------------------------------------------------------------- /__pycache__/fusion_strategy.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/fusion_strategy.cpython-36.pyc -------------------------------------------------------------------------------- /__pycache__/fusion_strategy.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/fusion_strategy.cpython-37.pyc -------------------------------------------------------------------------------- /__pycache__/fusion_strategy.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/fusion_strategy.cpython-38.pyc -------------------------------------------------------------------------------- /__pycache__/net.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/net.cpython-36.pyc -------------------------------------------------------------------------------- /__pycache__/net.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/net.cpython-37.pyc -------------------------------------------------------------------------------- /__pycache__/net.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/net.cpython-38.pyc -------------------------------------------------------------------------------- /__pycache__/net_visualization.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/net_visualization.cpython-37.pyc -------------------------------------------------------------------------------- /__pycache__/testMat.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/testMat.cpython-36.pyc -------------------------------------------------------------------------------- /__pycache__/testMat.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/testMat.cpython-37.pyc -------------------------------------------------------------------------------- /__pycache__/testMat.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/testMat.cpython-38.pyc -------------------------------------------------------------------------------- /__pycache__/utils.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/utils.cpython-36.pyc -------------------------------------------------------------------------------- /__pycache__/utils.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/utils.cpython-37.pyc -------------------------------------------------------------------------------- /__pycache__/utils.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/__pycache__/utils.cpython-38.pyc -------------------------------------------------------------------------------- /args_fusion.py: -------------------------------------------------------------------------------- 1 | 2 | class args(): 3 | 4 | # training args 5 | epochs = 3 #"number of training epochs, default is 2" 6 | batch_size = 1 7 | trainNumber = 2000 8 | 9 | HEIGHT = 256 10 | WIDTH = 256 11 | PATCH_SIZE = 128; 12 | PATCH_STRIDE = 4; 13 | 14 | save_model_dir = "models" #"path to folder where trained model will be saved." 15 | save_loss_dir = "models/loss" # "path to folder where trained model will be saved." 16 | 17 | image_size = 256 18 | cuda = 1 #"set it to 1 for running on GPU, 0 for CPU" 19 | 20 | lr = 1e-4 #"learning rate, default is 1e-4" 21 | lr_light = 1e-4 # "learning rate, default is 0.001" 22 | log_loss_interval = 5 #"number of images after which the training loss is logged, default is 500" 23 | log_model_interval = 100 24 | 25 | device = 0; 26 | 27 | model_path_gray = "./models/LLVIP_pretrained.model"; 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /clip/__init__.py: -------------------------------------------------------------------------------- 1 | from .clip import * 2 | -------------------------------------------------------------------------------- /clip/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/clip/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /clip/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/clip/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /clip/__pycache__/clip.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/clip/__pycache__/clip.cpython-37.pyc -------------------------------------------------------------------------------- /clip/__pycache__/clip.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/clip/__pycache__/clip.cpython-38.pyc -------------------------------------------------------------------------------- /clip/__pycache__/model.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/clip/__pycache__/model.cpython-37.pyc -------------------------------------------------------------------------------- /clip/__pycache__/model.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/clip/__pycache__/model.cpython-38.pyc -------------------------------------------------------------------------------- /clip/__pycache__/simple_tokenizer.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/clip/__pycache__/simple_tokenizer.cpython-37.pyc -------------------------------------------------------------------------------- /clip/__pycache__/simple_tokenizer.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/clip/__pycache__/simple_tokenizer.cpython-38.pyc -------------------------------------------------------------------------------- /clip/bpe_simple_vocab_16e6.txt.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/clip/bpe_simple_vocab_16e6.txt.gz -------------------------------------------------------------------------------- /data/country211.md: -------------------------------------------------------------------------------- 1 | # The Country211 Dataset 2 | 3 | In the paper, we used an image classification dataset called Country211, to evaluate the model's capability on geolocation. To do so, we filtered the YFCC100m dataset that have GPS coordinate corresponding to a [ISO-3166 country code](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes) and created a balanced dataset by sampling 150 train images, 50 validation images, and 100 test images images for each country. 4 | 5 | The following command will download an 11GB archive countaining the images and extract into a subdirectory `country211`: 6 | 7 | ```bash 8 | wget https://openaipublic.azureedge.net/clip/data/country211.tgz 9 | tar zxvf country211.tgz 10 | ``` 11 | 12 | These images are a subset of the YFCC100m dataset. Use of the underlying media files is subject to the Creative Commons licenses chosen by their creators/uploaders. For more information about the YFCC100M dataset, visit [the official website](https://multimediacommons.wordpress.com/yfcc100m-core-dataset/). -------------------------------------------------------------------------------- /data/rendered-sst2.md: -------------------------------------------------------------------------------- 1 | # The Rendered SST2 Dataset 2 | 3 | In the paper, we used an image classification dataset called Rendered SST2, to evaluate the model's capability on optical character recognition. To do so, we rendered the sentences in the [Standford Sentiment Treebank v2](https://nlp.stanford.edu/sentiment/treebank.html) dataset and used those as the input to the CLIP image encoder. 4 | 5 | The following command will download a 131MB archive countaining the images and extract into a subdirectory `rendered-sst2`: 6 | 7 | ```bash 8 | wget https://openaipublic.azureedge.net/clip/data/rendered-sst2.tgz 9 | tar zxvf rendered-sst2.tgz 10 | ``` 11 | 12 | -------------------------------------------------------------------------------- /data/yfcc100m.md: -------------------------------------------------------------------------------- 1 | # The YFCC100M Subset 2 | 3 | In the paper, we performed a dataset ablation using a subset of the YFCC100M dataset and showed that the performance remained largely similar. 4 | 5 | The subset contains 14,829,396 images, about 15% of the full dataset, which have been filtered to only keep those with natural languag titles and/or descriptions in English. 6 | 7 | We provide the list of (line number, photo identifier, photo hash) of each image contained in this subset. These correspond to the first three columns in the dataset's metadata TSV file. 8 | 9 | ```bash 10 | wget https://openaipublic.azureedge.net/clip/data/yfcc100m_subset_data.tsv.bz2 11 | bunzip2 yfcc100m_subset_data.tsv.bz2 12 | ``` 13 | 14 | Use of the underlying media files is subject to the Creative Commons licenses chosen by their creators/uploaders. For more information about the YFCC100M dataset, visit [the official website](https://multimediacommons.wordpress.com/yfcc100m-core-dataset/). -------------------------------------------------------------------------------- /docker_stderror: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/docker_stderror -------------------------------------------------------------------------------- /fusion_strategy.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import torch.nn.functional as F 3 | 4 | EPSILON = 1e-10 5 | 6 | 7 | # addition fusion strategy 8 | def addition_fusion(tensor1, tensor2): 9 | return (tensor1 + tensor2)/2 10 | 11 | def MAXFusion(tensor1, tensor2): 12 | return torch.max(tensor1,tensor2); 13 | 14 | # attention fusion strategy, average based on weight maps 15 | def L1Fusion(tensor1, tensor2): 16 | # avg, max, nuclear 17 | f_spatial = spatial_fusion(tensor1, tensor2) 18 | tensor_f = f_spatial 19 | return tensor_f 20 | 21 | def SCFusion(tensor1,tensor2): 22 | f_spatial = spatial_fusion(tensor1, tensor2); 23 | f_channel = channel_fusion(tensor1, tensor2); 24 | a = 0; 25 | print("a="+str(a)); 26 | tensor_f = a*f_spatial + (1-a)*f_channel; 27 | return tensor_f; 28 | 29 | def channel_fusion(tensor1, tensor2): 30 | shape = tensor1.size() 31 | global_p1 = channel_attention(tensor1) 32 | global_p2 = channel_attention(tensor2) 33 | 34 | global_p_w1 = global_p1 / (global_p1+global_p2+EPSILON) 35 | global_p_w2 = global_p2 / (global_p1+global_p2+EPSILON) 36 | 37 | global_p_w1 = global_p_w1.repeat(1,1,shape[2],shape[3]) 38 | global_p_w2 = global_p_w2.repeat(1,1,shape[2],shape[3]) 39 | 40 | tensorf = global_p_w1 * tensor1 + global_p_w2 * tensor2 41 | 42 | return tensorf 43 | 44 | def channel_attention(tensor, pooling_type = 'avg'): 45 | shape = tensor.size() 46 | global_p = F.avg_pool2d(tensor,kernel_size=shape[2:]) 47 | return global_p 48 | 49 | def spatial_fusion(tensor1, tensor2, spatial_type='sum'): 50 | shape = tensor1.size() 51 | spatial1 = spatial_attention(tensor1, spatial_type) 52 | spatial2 = spatial_attention(tensor2, spatial_type) 53 | spatial_w1 = torch.exp(spatial1) / (torch.exp(spatial1) + torch.exp(spatial2) + EPSILON) 54 | spatial_w2 = torch.exp(spatial2) / (torch.exp(spatial1) + torch.exp(spatial2) + EPSILON) 55 | spatial_w1 = spatial_w1.repeat(1, shape[1], 1, 1) 56 | spatial_w2 = spatial_w2.repeat(1, shape[1], 1, 1) 57 | 58 | tensor_f = spatial_w1 * tensor1 + spatial_w2 * tensor2 59 | 60 | return tensor_f 61 | 62 | 63 | def spatial_attention(tensor, spatial_type='sum'): 64 | if spatial_type == 'mean': 65 | spatial = tensor.mean(dim=1, keepdim=True) 66 | elif spatial_type == 'sum': 67 | spatial = tensor.sum(dim=1, keepdim=True) 68 | return spatial 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /genMat.py: -------------------------------------------------------------------------------- 1 | import scipy.io as scio 2 | import matplotlib 3 | matplotlib.use('Agg') 4 | import matplotlib.pyplot as plt 5 | 6 | def showLossChart(path,savedName): 7 | plt.cla(); 8 | plt.clf(); 9 | if (path == ""): 10 | return; 11 | #path = 'savedLossMat/LossMat_Epoch:_(5_20)_Step:_(450_590).mat' 12 | 13 | data = scio.loadmat(path) 14 | #type(data) 15 | 16 | #print(dict) # data是字典格式 17 | 18 | #print(data.keys()) # 查看字典的键 19 | 20 | #loss =data['finalLoss'][0]; 21 | loss =data['Loss'][0]; 22 | 23 | #print(loss); 24 | 25 | x_data = range(0,len(loss)); 26 | y_data = loss; 27 | 28 | plt.plot(x_data,y_data); 29 | plt.xlabel("Step"); 30 | plt.ylabel("Loss"); 31 | plt.savefig(savedName); 32 | 33 | 34 | showLossChart("","test.png"); -------------------------------------------------------------------------------- /hubconf.py: -------------------------------------------------------------------------------- 1 | from clip.clip import tokenize as _tokenize, load as _load, available_models as _available_models 2 | import re 3 | import string 4 | 5 | dependencies = ["torch", "torchvision", "ftfy", "regex", "tqdm"] 6 | 7 | # For compatibility (cannot include special characters in function name) 8 | model_functions = { model: re.sub(f'[{string.punctuation}]', '_', model) for model in _available_models()} 9 | 10 | def _create_hub_entrypoint(model): 11 | def entrypoint(**kwargs): 12 | return _load(model, **kwargs) 13 | 14 | entrypoint.__doc__ = f"""Loads the {model} CLIP model 15 | 16 | Parameters 17 | ---------- 18 | device : Union[str, torch.device] 19 | The device to put the loaded model 20 | 21 | jit : bool 22 | Whether to load the optimized JIT model or more hackable non-JIT model (default). 23 | 24 | download_root: str 25 | path to download the model files; by default, it uses "~/.cache/clip" 26 | 27 | Returns 28 | ------- 29 | model : torch.nn.Module 30 | The {model} CLIP model 31 | 32 | preprocess : Callable[[PIL.Image], torch.Tensor] 33 | A torchvision transform that converts a PIL image into a tensor that the returned model can take as its input 34 | """ 35 | return entrypoint 36 | 37 | def tokenize(): 38 | return _tokenize 39 | 40 | _entrypoints = {model_functions[model]: _create_hub_entrypoint(model) for model in _available_models()} 41 | 42 | globals().update(_entrypoints) -------------------------------------------------------------------------------- /models/LLVIP_pretrained.model: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/models/LLVIP_pretrained.model -------------------------------------------------------------------------------- /output/fused.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/output/fused.jpg -------------------------------------------------------------------------------- /output/fused_gray.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/output/fused_gray.jpg -------------------------------------------------------------------------------- /pytorch_msssim/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/pytorch_msssim/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /pytorch_msssim/__pycache__/__init__.cpython-37.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/pytorch_msssim/__pycache__/__init__.cpython-37.pyc -------------------------------------------------------------------------------- /pytorch_msssim/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/pytorch_msssim/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /samples/description.txt: -------------------------------------------------------------------------------- 1 | A pedestrian is walking on the sidewalk. -------------------------------------------------------------------------------- /samples/ir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/samples/ir.png -------------------------------------------------------------------------------- /samples/vis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/samples/vis.png -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | import pkg_resources 4 | from setuptools import setup, find_packages 5 | 6 | setup( 7 | name="clip", 8 | py_modules=["clip"], 9 | version="1.0", 10 | description="", 11 | author="OpenAI", 12 | packages=find_packages(exclude=["tests*"]), 13 | install_requires=[ 14 | str(r) 15 | for r in pkg_resources.parse_requirements( 16 | open(os.path.join(os.path.dirname(__file__), "requirements.txt")) 17 | ) 18 | ], 19 | include_package_data=True, 20 | extras_require={'dev': ['pytest']}, 21 | ) 22 | -------------------------------------------------------------------------------- /testMat.py: -------------------------------------------------------------------------------- 1 | import scipy.io as scio 2 | import matplotlib 3 | matplotlib.use('Agg') 4 | import matplotlib.pyplot as plt 5 | 6 | def showLossChart(path,savedName): 7 | plt.cla(); 8 | plt.clf(); 9 | if (path == ""): 10 | return; 11 | #path = 'savedLossMat/LossMat_Epoch:_(5_20)_Step:_(450_590).mat' 12 | 13 | data = scio.loadmat(path) 14 | #type(data) 15 | 16 | #print(dict) # data是字典格式 17 | 18 | #print(data.keys()) # 查看字典的键 19 | 20 | #loss =data['finalLoss'][0]; 21 | loss =data['Loss'][0]; 22 | 23 | #print(loss); 24 | 25 | x_data = range(0,len(loss)); 26 | y_data = loss; 27 | 28 | plt.plot(x_data,y_data); 29 | plt.xlabel("Step"); 30 | plt.ylabel("Loss"); 31 | plt.savefig(savedName); 32 | 33 | 34 | showLossChart("","test.png"); -------------------------------------------------------------------------------- /textual_attention_metrics/IVT_LLVIP_test250_textConfidence.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/IVT_LLVIP_test250_textConfidence.mat -------------------------------------------------------------------------------- /textual_attention_metrics/IVT_RoadScene50_textConfidence.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/IVT_RoadScene50_textConfidence.mat -------------------------------------------------------------------------------- /textual_attention_metrics/IVT_TNO_test30_textConfidence.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/IVT_TNO_test30_textConfidence.mat -------------------------------------------------------------------------------- /textual_attention_metrics/IVT_test_TNO/ir/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/IVT_test_TNO/ir/1.png -------------------------------------------------------------------------------- /textual_attention_metrics/IVT_test_TNO/ir/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/IVT_test_TNO/ir/2.png -------------------------------------------------------------------------------- /textual_attention_metrics/IVT_test_TNO/vis/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/IVT_test_TNO/vis/1.png -------------------------------------------------------------------------------- /textual_attention_metrics/IVT_test_TNO/vis/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/IVT_test_TNO/vis/2.png -------------------------------------------------------------------------------- /textual_attention_metrics/README.md: -------------------------------------------------------------------------------- 1 | ## Textual Attention Metrics 2 | 3 | ### Usage 4 | Run the following prompt on the Matlab platform (R2018b version is recommended) 5 | 6 | ``` 7 | main_evaluation 8 | ``` 9 | 10 | The metrics (.xlsx) will be saved in folder of the fusion results (from left to right: Qabf+, SSIM+, VIF+). 11 | 12 | ### Text-guided Images 13 | Link to the completed text-guided images: [Google Drive](https://drive.google.com/file/d/1AQEtc1rLMqSOUOU22JZj2a8dDe2AT9fh/view?usp=drive_link). 14 | 15 | ### Text confidence 16 | 17 | We already provide the text confidence for three datasets , i.e., LLVIP, TNO, and RoadScene. 18 | 19 | If you want to calculate the text confidence of your own dataset, please refer to the training [code](https://github.com/AWCXV/TextFusion-Association_for_Training) that generates the association map. 20 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/1.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/1.bmp -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/2.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/2.bmp -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/VIF/VIF_test.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/VIF/VIF_test.m -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/VIF/buildSpyr.m: -------------------------------------------------------------------------------- 1 | % [PYR, INDICES, STEERMTX, HARMONICS] = buildSpyr(IM, HEIGHT, FILTFILE, EDGES) 2 | % 3 | % Construct a steerable pyramid on matrix IM. Convolutions are 4 | % done with spatial filters. 5 | % 6 | % HEIGHT (optional) specifies the number of pyramid levels to build. Default 7 | % is maxPyrHt(size(IM),size(FILT)). 8 | % You can also specify 'auto' to use this value. 9 | % 10 | % FILTFILE (optional) should be a string referring to an m-file that 11 | % returns the rfilters. (examples: 'sp0Filters', 'sp1Filters', 12 | % 'sp3Filters','sp5Filters'. default = 'sp1Filters'). EDGES specifies 13 | % edge-handling, and defaults to 'reflect1' (see corrDn). 14 | % 15 | % PYR is a vector containing the N pyramid subbands, ordered from fine 16 | % to coarse. INDICES is an Nx2 matrix containing the sizes of 17 | % each subband. This is compatible with the MatLab Wavelet toolbox. 18 | % See the function STEER for a description of STEERMTX and HARMONICS. 19 | 20 | % Eero Simoncelli, 6/96. 21 | % See http://www.cis.upenn.edu/~eero/steerpyr.html for more 22 | % information about the Steerable Pyramid image decomposition. 23 | 24 | function [pyr,pind,steermtx,harmonics] = buildSpyr(im, ht, filtfile, edges) 25 | 26 | %----------------------------------------------------------------- 27 | %% DEFAULTS: 28 | 29 | if (exist('filtfile') ~= 1) 30 | filtfile = 'sp1Filters'; 31 | end 32 | 33 | if (exist('edges') ~= 1) 34 | edges= 'reflect1'; 35 | end 36 | 37 | if (isstr(filtfile) & (exist(filtfile) == 2)) 38 | [lo0filt,hi0filt,lofilt,bfilts,steermtx,harmonics] = eval(filtfile); 39 | else 40 | fprintf(1,'\nUse buildSFpyr for pyramids with arbitrary numbers of orientation bands.\n'); 41 | error('FILTFILE argument must be the name of an M-file containing SPYR filters.'); 42 | end 43 | 44 | max_ht = maxPyrHt(size(im), size(lofilt,1)); 45 | if ( (exist('ht') ~= 1) | (ht == 'auto') ) 46 | ht = max_ht; 47 | else 48 | if (ht > max_ht) 49 | error(sprintf('Cannot build pyramid higher than %d levels.',max_ht)); 50 | end 51 | end 52 | 53 | %----------------------------------------------------------------- 54 | 55 | hi0 = corrDn(im, hi0filt, edges); 56 | lo0 = corrDn(im, lo0filt, edges); 57 | 58 | [pyr,pind] = buildSpyrLevs(lo0, ht, lofilt, bfilts, edges); 59 | 60 | pyr = [hi0(:) ; pyr]; 61 | pind = [size(hi0); pind]; 62 | 63 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/VIF/ind2wtree.m: -------------------------------------------------------------------------------- 1 | function wtree = ind2wtree(pyr, ind) 2 | 3 | %this function is called by vifvec.m 4 | % converts the output of Eero Simoncelli's pyramid routines into subbands in a cell array 5 | C=pyr; 6 | S=ind; 7 | 8 | offset=0; 9 | numsubs=size(ind,1); 10 | for i=1:numsubs 11 | wtree{numsubs-i+1}=reshape(C(offset+1:offset+prod(S(i,:))), S(i,1),S(i,2)); 12 | offset=offset+prod(S(i,:)); 13 | end 14 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/VIF/refparams_vecgsm.m: -------------------------------------------------------------------------------- 1 | function [ssarr, l_arr, cu_arr]=refparams_vecgsm(org,subands,M) 2 | 3 | %This function computes the parameters of the reference image. This is 4 | %called by vifvec.m. 5 | 6 | for i=1:length(subands); 7 | sub=subands(i); 8 | y=org{sub}; 9 | 10 | sizey=floor(size(y)./M)*M; % crop to exact multiple size 11 | y=y(1:sizey(1),1:sizey(2)); 12 | 13 | 14 | % Collect MxM blocks. Rearrange each block into an 15 | % M^2 dimensional vector and collect all such vectors. 16 | % Collece ALL possible MXM blocks (even those overlapping) from the subband 17 | temp=[]; 18 | for j=1:M 19 | for k=1:M 20 | temp=cat(1,temp,reshape(y(k:end-(M-k), j:end-(M-j)),1,[])); 21 | end 22 | end 23 | 24 | % estimate mean and covariance 25 | mcu=mean(temp')'; 26 | cu=((temp-repmat(mcu,1,size(temp,2)))*(temp-repmat(mcu,1,size(temp,2)))')./size(temp,2); % covariance matrix for U 27 | 28 | % Collect MxM blocks as above. Use ONLY non-overlapping blocks to 29 | % calculate the S field 30 | temp=[]; 31 | for j=1:M 32 | for k=1:M 33 | temp=cat(1,temp,reshape(y(k:M:end, j:M:end),1,[])); 34 | end 35 | end 36 | 37 | % Calculate the S field 38 | ss=(inv(cu)*temp); 39 | ss=sum(ss.*temp)./(M*M); 40 | ss=reshape(ss,sizey/M); 41 | 42 | % Eigen-decomposition 43 | [v,d]=eig(cu); 44 | l_arr(sub,:)=diag(d)'; 45 | 46 | % rearrange for output 47 | ssarr{sub}=ss; 48 | temp=0; 49 | d=diag(d); 50 | cu_arr{sub}=cu; 51 | end 52 | 53 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/VIF/vifsub_est_M.m: -------------------------------------------------------------------------------- 1 | function [g_all, vv_all]=vifsub_est_M(org,dist, subbands, M); 2 | 3 | % uses convolution for determining the parameters of the distortion channel 4 | % Called by vifvec.m 5 | 6 | tol = 1e-15; % tolernace for zero variance. Variance below this is set to zero, and zero is set to this value to avoid numerical issues. 7 | 8 | 9 | for i=1:length(subbands) 10 | sub=subbands(i); 11 | y=org{sub}; 12 | yn=dist{sub}; 13 | 14 | % compute the size of the window used in the distortion channel estimation 15 | lev=ceil((sub-1)/6); 16 | winsize=2^lev+1; offset=(winsize-1)/2; 17 | win = ones(winsize); 18 | 19 | % force subband size to be multiple of M 20 | newsize=floor(size(y)./M)*M; 21 | y=y(1:newsize(1),1:newsize(2)); 22 | yn=yn(1:newsize(1),1:newsize(2)); 23 | 24 | % Correlation with downsampling. This is faster than downsampling after 25 | % computing full correlation. 26 | winstep=[M M]; 27 | winstart=[1 1].*floor(M/2)+1; 28 | winstop=size(y)-ceil(M/2)+1; 29 | 30 | % mean 31 | mean_x = corrDn(y,win/sum(win(:)),'reflect1',winstep, winstart,winstop); 32 | mean_y = corrDn(yn,win/sum(win(:)),'reflect1',winstep, winstart,winstop); 33 | % cov 34 | cov_xy = corrDn(y.*yn, win, 'reflect1',winstep, winstart,winstop) - sum(win(:)).*mean_x.*mean_y; 35 | % var 36 | ss_x = corrDn(y.^2,win, 'reflect1',winstep, winstart,winstop) - sum(win(:)).*mean_x.^2; 37 | ss_y = corrDn(yn.^2,win, 'reflect1',winstep, winstart,winstop) - sum(win(:)).*mean_y.^2; 38 | 39 | 40 | % get rid of numerical problems, very small negative numbers, or very 41 | % small positive numbers, or other theoretical impossibilities. 42 | ss_x(ss_x<0)=0; 43 | ss_y(ss_y<0)=0; 44 | 45 | % Regression 46 | g = cov_xy./(ss_x+tol); 47 | 48 | % Variance of error in regression 49 | vv = (ss_y - g.*cov_xy)/(sum(win(:))); 50 | 51 | % get rid of numerical problems, very small negative numbers, or very 52 | % small positive numbers, or other theoretical impossibilities. 53 | g (ss_x < tol) = 0; 54 | vv (ss_x < tol) = ss_y (ss_x < tol); 55 | ss_x(ss_x=rawL(r,c); 49 | mapResultOrder = enhanceResultL>=enhanceResultL(r,c); 50 | mapError = xor(mapRawOrder,mapResultOrder); 51 | error = error + sum(mapError(:)); 52 | mask(r,c) = sum(mapError(:)); 53 | end 54 | end 55 | 56 | %% save mask to file 57 | fileName = globalVar('TestImage_resultFile', 'tmp'); % Test_resultFile 58 | dirname = rename(fileName, '/loe100x100'); 59 | if ~exist(dirname,'dir'), mkdir(dirname); end 60 | figure; imshow(mask./5000, 'Border','tight','InitialMagnification',500); % colormap jet 61 | print(gcf, rename(fileName, '/loe100x100/loe100x100_'), '-djpeg'); close(gcf); 62 | 63 | 64 | lightOrderError = error / (N*N); %(size(raw,1)*size(raw,2)); 65 | 66 | end 67 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/-MacReadMe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/-MacReadMe -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/compilePyrTools.m: -------------------------------------------------------------------------------- 1 | % This is a script file for compiling the mex versions of the Steerable 2 | % Pyramid Tools. 3 | % 4 | % Usage:>> compilePyrTools 5 | % 6 | % Tested for gcc and lcc. 7 | % 8 | % Rob Young, 9/08 9 | 10 | mex upConv.c convolve.c wrap.c edges.c 11 | mex corrDn.c convolve.c wrap.c edges.c 12 | mex histo.c 13 | %mex innerProd.c 14 | mex pointOp.c 15 | mex range2.c 16 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/convolve.h: -------------------------------------------------------------------------------- 1 | /* 2 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3 | ;;; File: convolve.h 4 | ;;; Author: Simoncelli 5 | ;;; Description: Header file for convolve.c 6 | ;;; Creation Date: 7 | ;;; ---------------------------------------------------------------- 8 | ;;; Object-Based Vision and Image Understanding System (OBVIUS), 9 | ;;; Copyright 1988, Vision Science Group, Media Laboratory, 10 | ;;; Massachusetts Institute of Technology. 11 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 12 | */ 13 | 14 | #include 15 | #include 16 | 17 | #define ABS(x) (((x)>=0) ? (x) : (-(x))) 18 | #define ROOT2 1.4142135623730951 19 | #define REDUCE 0 20 | #define EXPAND 1 21 | #define IS == 22 | #define ISNT != 23 | #define AND && 24 | #define OR || 25 | 26 | typedef int (*fptr)(); 27 | 28 | typedef struct 29 | { 30 | char *name; 31 | fptr func; 32 | } EDGE_HANDLER; 33 | 34 | typedef double image_type; 35 | 36 | fptr edge_function(char *edges); 37 | int internal_reduce(image_type *image, int x_idim, int y_idim, 38 | image_type *filt, image_type *temp, int x_fdim, int y_fdim, 39 | int x_start, int x_step, int x_stop, 40 | int y_start, int y_step, int y_stop, 41 | image_type *result, char *edges); 42 | int internal_expand(image_type *image, 43 | image_type *filt, image_type *temp, int x_fdim, int y_fdim, 44 | int x_start, int x_step, int x_stop, 45 | int y_start, int y_step, int y_stop, 46 | image_type *result, int x_rdim, int y_rdim, char *edges); 47 | int internal_wrap_reduce(image_type *image, int x_idim, int y_idim, 48 | image_type *filt, int x_fdim, int y_fdim, 49 | int x_start, int x_step, int x_stop, 50 | int y_start, int y_step, int y_stop, 51 | image_type *result); 52 | int internal_wrap_expand(image_type *image, image_type *filt, int x_fdim, int y_fdim, 53 | int x_start, int x_step, int x_stop, 54 | int y_start, int y_step, int y_stop, 55 | image_type *result, int x_rdim, int y_rdim); 56 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/corrDn.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/corrDn.mexa64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/corrDn.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/corrDn.mexglx -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/corrDn.mexmac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/corrDn.mexmac -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/corrDn.mexmaci: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/corrDn.mexmaci -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/corrDn.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/corrDn.mexmaci64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/corrDn.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/corrDn.mexw32 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/histo.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/histo.mexa64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/histo.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/histo.mexglx -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/histo.mexmac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/histo.mexmac -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/histo.mexmaci: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/histo.mexmaci -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/histo.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/histo.mexmaci64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/histo.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/histo.mexw32 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/innerProd.c: -------------------------------------------------------------------------------- 1 | /* 2 | RES = innerProd(MAT); 3 | Computes mat'*mat 4 | Odelia Schwartz, 8/97. 5 | */ 6 | 7 | #define V4_COMPAT 8 | #include 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | void mexFunction(int nlhs, /* Num return vals on lhs */ 17 | mxArray *plhs[], /* Matrices on lhs */ 18 | int nrhs, /* Num args on rhs */ 19 | const mxArray *prhs[] /* Matrices on rhs */ 20 | ) 21 | { 22 | register double *res, *mat, tmp; 23 | register int len, wid, i, k, j, jlen, ilen, imat, jmat; 24 | mxArray *arg; 25 | 26 | /* get matrix input argument */ 27 | /* should be matrix in which num rows >= num columns */ 28 | arg=prhs[0]; 29 | mat= mxGetPr(arg); 30 | len = (int) mxGetM(arg); 31 | wid = (int) mxGetN(arg); 32 | if ( wid > len ) 33 | printf("innerProd: Warning: width %d is greater than length %d.\n",wid,len); 34 | plhs[0] = (mxArray *) mxCreateDoubleMatrix(wid,wid,mxREAL); 35 | if (plhs[0] == NULL) 36 | mexErrMsgTxt(sprintf("Error allocating %dx%d result matrix",wid,wid)); 37 | res = mxGetPr(plhs[0]); 38 | 39 | for(i=0, ilen=0; i>> See range2.m for documentation <<< 4 | EPS, 3/97. 5 | */ 6 | 7 | #define V4_COMPAT 8 | #include /* Matlab matrices */ 9 | #include 10 | 11 | #include /* NULL */ 12 | 13 | #define notDblMtx(it) (!mxIsNumeric(it) || !mxIsDouble(it) || mxIsSparse(it) || mxIsComplex(it)) 14 | 15 | void mexFunction(int nlhs, /* Num return vals on lhs */ 16 | mxArray *plhs[], /* Matrices on lhs */ 17 | int nrhs, /* Num args on rhs */ 18 | const mxArray *prhs[] /* Matrices on rhs */ 19 | ) 20 | { 21 | register double temp, mn, mx; 22 | register double *mtx; 23 | register int i, size; 24 | const mxArray *arg; 25 | 26 | if (nrhs != 1) mexErrMsgTxt("requires 1 argument."); 27 | 28 | /* ARG 1: MATRIX */ 29 | arg = prhs[0]; 30 | if notDblMtx(arg) mexErrMsgTxt("MTX arg must be a real non-sparse matrix."); 31 | mtx = mxGetPr(arg); 32 | size = (int) mxGetM(arg) * mxGetN(arg); 33 | 34 | /* FIND min, max values of MTX */ 35 | mn = *mtx; mx = *mtx; 36 | for (i=1; i mx) 42 | mx = temp; 43 | } 44 | 45 | plhs[0] = (mxArray *) mxCreateDoubleMatrix(1,1,mxREAL); 46 | if (plhs[0] == NULL) mexErrMsgTxt("Error allocating result matrix"); 47 | plhs[1] = (mxArray *) mxCreateDoubleMatrix(1,1,mxREAL); 48 | if (plhs[1] == NULL) mexErrMsgTxt("Error allocating result matrix"); 49 | mtx = mxGetPr(plhs[0]); 50 | mtx[0] = mn; 51 | mtx = mxGetPr(plhs[1]); 52 | mtx[0] = mx; 53 | 54 | return; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/range2.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/range2.mexa64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/range2.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/range2.mexglx -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/range2.mexmac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/range2.mexmac -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/range2.mexmaci: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/range2.mexmaci -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/range2.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/range2.mexmaci64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/range2.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/range2.mexw32 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/upConv.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/upConv.mexa64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/upConv.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/upConv.mexglx -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/upConv.mexmac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/upConv.mexmac -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/upConv.mexmaci: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/upConv.mexmaci -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/upConv.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/upConv.mexmaci64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/MEX/upConv.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/MEX/upConv.mexw32 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/README: -------------------------------------------------------------------------------- 1 | =========================== matlabPyrTools ============================ 2 | 3 | This package contains some MatLab tools for multi-scale image 4 | processing. Briefly, the tools include: 5 | - Recursive multi-scale image decompositions (pyramids), including 6 | Laplacian pyramids, QMFs, Wavelets, and steerable pyramids. These 7 | operate on 1D or 2D signals of arbitrary dimension. Data 8 | structures are compatible with the MatLab wavelet toolbox. 9 | - Fast 2D convolution routines, with subsampling and boundary-handling. 10 | - Fast point-operations, histograms, histogram-matching. 11 | - Fast synthetic image generation: sine gratings, zone plates, fractals, etc. 12 | - Display routines for images and pyramids. These include several 13 | auto-scaling options, rounding to integer zoom factors to avoid 14 | resampling artifacts, and useful labeling (dimensions and gray-range). 15 | 16 | The package is available as a gnu-zipped UNIX "tar" file, accessible 17 | from the web page: http://www.cns.nyu.edu/~lcv/software.html 18 | 19 | The code was originally written in Matlab version 4.2, and continues 20 | to work in new versions (as of 12/09). To use the code (these lines 21 | are for UNIX): 22 | 1) gunzip matlabPyrTools.tar.gz # unpack g'zipped file 23 | 2) tar tvf matlabPyrTools.tar # view contents 24 | 3) tar xvf matlabPyrTools.tar # extract into directory "matlabPyrTools" 25 | 4) rm matlabPyrTools.tar # delete tarfile 26 | 5) Run matlab, and execute: 27 | addpath(); 28 | help matlabPyrTools 29 | 30 | A few functions are actually MEX interfaces to C code. These are 31 | contained in the subdirectory called MEX. The MEX files have been 32 | tested on Sun (Solaris), LinuX (on an Intel platform), and Macintosh 33 | OSX (on PowerPC and Intel), but should not be difficult to compile on 34 | most other platforms. Source code is included in the MEX directory, 35 | as well as Make files. Pre-compiled versions are included for a 36 | number of platforms. To compile on your platform, simply run 37 | compilePyrTools.m which is located in the MEX subdirectory. 38 | 39 | To make sure these are in your matlab path, you can do *one* of the 40 | following: 41 | 1) Create a symbolic link (or macintosh "alias") for the relavent files 42 | in the main matlabPyrTools directory, or 43 | 2) Copy the relavent files into the main matlabPyrTools directory, or 44 | 3) Put the MEX subdirectory in your matlab path: addpath('matlabPyrTools/MEX'); 45 | 46 | Some example script files showing usage of the code are in the 47 | directory /TUTORIALS. There is a README file in that directory 48 | describing the contents. 49 | 50 | Incremental changes/updates to the code are documented in the ChangeLog file. 51 | 52 | Comments/Suggestions/Bugs to: 53 | Eero P. Simoncelli 54 | Center for Neural Science, and 55 | Courant Institute for Mathematical Sciences 56 | New York University 57 | eero.simoncelli@nyu.edu 58 | http://www.cns.nyu.edu/~eero/ 59 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/lcv.css: -------------------------------------------------------------------------------- 1 | BODY {margin-left:20; margin-top:5; margin-width:15; margin-height:5; font-family:helvetica,arial,sans-serif} 2 | 3 | P.titledlist {margin-left: 2.4em; text-indent: -2.4em; line-height: 1.3; 4 | margin-top: 1.8ex; margin-bottom: 1.8ex;} 5 | 6 | P.people { margin-top: 0ex; margin-bottom: 0.6ex; margin-left: 12px; 7 | text-indent: -12px; } 8 | 9 | P.research {margin-top: 1ex; margin-bottom: 1ex;} 10 | 11 | UL.compact {list-style-image:none; list-style: inside disc } 12 | 13 | LI.software {margin-top: 1ex; margin-bottom: 0ex;} 14 | 15 | a:link {text-decoration:none;} 16 | 17 | a:visited {text-decoration:none;} 18 | 19 | a:hover {color:blue; text-decoration:underline;} 20 | 21 | a span {display:none;} 22 | 23 | a:hover span {display:block; position:fixed; left:150px; padding:5px; background: #f0f0f0; border: 1px dotted #c0c0c0; opacity: 1;} 24 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_0.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_0.1.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_0.2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_0.2.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_0.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_0.3.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_01.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_02.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_03.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_04.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_05.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_06.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_07.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_08.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_09.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_10.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_11.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_12.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_13.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_14.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_15.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_16.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_17.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_18.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_19.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_20.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_21.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_22.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_23.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/matlabPyrTools_24.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_01.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_02.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_03.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_04.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_05.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_06.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_07.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_08.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_09.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_10.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_11.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_11.5.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_11.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_12.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_13.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_14.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_15.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_16.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_17.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_18.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_19.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_20.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_21.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_22.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_23.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_24.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_25.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_26.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_27.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_28.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_28.5.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_28.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_29.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_30.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_31.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_32.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_33.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_34.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_34.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_35.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_36.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_36.5.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_36.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_37.3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_37.3.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_37.6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_37.6.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_37.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_38.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_38.5.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_38.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_39.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_39.5.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_39.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_39.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_40.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_41.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_42.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_43.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_43.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_44.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_45.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_46.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_47.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_47.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_48.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_49.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_5.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_5.5.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_50.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_51.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_51.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_52.5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_52.5.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_52.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_52.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_53.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_53.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_54.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_54.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_55.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_56.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_56.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_57.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_58.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_58.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_59.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_59.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_60.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_60.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_61.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_61.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_62.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_62.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_63.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_63.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_64.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_65.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_65.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_66.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_66.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_67.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_67.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_68.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_68.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_69.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_69.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_70.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_71.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_71.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_72.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_73.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_73.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_74.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_74.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_75.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/HTML/pyramids_75.png -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/TUTORIALS/README: -------------------------------------------------------------------------------- 1 | 2 | This directory contains some Matlab script files that serve to give 3 | example usage of this code, and also to explain some of the 4 | representations and algorithms. 5 | 6 | The files are NOT meant to be executed from the MatLab prompt (like many 7 | of the MatLab demos). You should instead read through the comments, 8 | executing the subsequent pieces of code. This gives you a chance to 9 | explore as you go... 10 | 11 | matlabPyrTools.m - Example usage of the code in the distribution. 12 | 13 | pyramids.m - An introduction to multi-scale pyramid representations, 14 | covering Laplacian, QMF/Wavelet, and Steerable pyramids. The 15 | file assumes a knowledge of linear systems, matrix algebra, 16 | and 2D Fourier transforms. 17 | 18 | matlabPyrTools.html - Same as matlabPyrTools.m, but formatted in html that 19 | shows sample output. 20 | 21 | pyramids.html - Same as pyramids.m, but formatted in html that shows sample 22 | output. 23 | 24 | more to come.... 25 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/binomialFilter.m: -------------------------------------------------------------------------------- 1 | % KERNEL = binomialFilter(size) 2 | % 3 | % Returns a vector of binomial coefficients of order (size-1) . 4 | 5 | % Eero Simoncelli, 2/97. 6 | 7 | function [kernel] = binomialFilter(sz) 8 | 9 | if (sz < 2) 10 | error('size argument must be larger than 1'); 11 | end 12 | 13 | kernel = [0.5 0.5]'; 14 | 15 | for n=1:sz-2 16 | kernel = conv([0.5 0.5]', kernel); 17 | end 18 | 19 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/blur.m: -------------------------------------------------------------------------------- 1 | % RES = blur(IM, LEVELS, FILT) 2 | % 3 | % Blur an image, by filtering and downsampling LEVELS times 4 | % (default=1), followed by upsampling and filtering LEVELS times. The 5 | % blurring is done with filter kernel specified by FILT (default = 6 | % 'binom5'), which can be a string (to be passed to namedFilter), a 7 | % vector (applied separably as a 1D convolution kernel in X and Y), or 8 | % a matrix (applied as a 2D convolution kernel). The downsampling is 9 | % always by 2 in each direction. 10 | 11 | % Eero Simoncelli, 3/04. 12 | 13 | function res = blur(im, nlevs, filt) 14 | 15 | %------------------------------------------------------------ 16 | %% OPTIONAL ARGS: 17 | 18 | if (exist('nlevs') ~= 1) 19 | nlevs = 1; 20 | end 21 | 22 | if (exist('filt') ~= 1) 23 | filt = 'binom5'; 24 | end 25 | 26 | %------------------------------------------------------------ 27 | 28 | if isstr(filt) 29 | filt = namedFilter(filt); 30 | end 31 | 32 | filt = filt/sum(filt(:)); 33 | 34 | if nlevs > 0 35 | if (any(size(im)==1)) 36 | if (~any(size(filt)==1)) 37 | error('Cant apply 2D filter to 1D signal'); 38 | end 39 | if (size(im,2)==1) 40 | filt = filt(:); 41 | else 42 | filt = filt(:)'; 43 | end 44 | 45 | in = corrDn(im,filt,'reflect1',(size(im)~=1)+1); 46 | out = blur(in, nlevs-1, filt); 47 | res = upConv(out, filt, 'reflect1', (size(im)~=1)+1, [1 1], size(im)); 48 | 49 | elseif (any(size(filt)==1)) 50 | filt = filt(:); 51 | 52 | in = corrDn(im,filt,'reflect1',[2 1]); 53 | in = corrDn(in,filt','reflect1',[1 2]); 54 | out = blur(in, nlevs-1, filt); 55 | res = upConv(out, filt', 'reflect1', [1 2], [1 1], [size(out,1),size(im,2)]); 56 | res = upConv(res, filt, 'reflect1', [2 1], [1 1], size(im)); 57 | 58 | else 59 | 60 | in = corrDn(im,filt,'reflect1',[2 2]); 61 | out = blur(in, nlevs-1, filt); 62 | res = upConv(out, filt, 'reflect1', [2 2], [1 1], size(im)); 63 | end 64 | else 65 | res = im; 66 | end 67 | 68 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/blurDn.m: -------------------------------------------------------------------------------- 1 | % RES = blurDn(IM, LEVELS, FILT) 2 | % 3 | % Blur and downsample an image. The blurring is done with filter 4 | % kernel specified by FILT (default = 'binom5'), which can be a string 5 | % (to be passed to namedFilter), a vector (applied separably as a 1D 6 | % convolution kernel in X and Y), or a matrix (applied as a 2D 7 | % convolution kernel). The downsampling is always by 2 in each 8 | % direction. 9 | % 10 | % The procedure is applied recursively LEVELS times (default=1). 11 | 12 | % Eero Simoncelli, 3/97. 13 | 14 | function res = blurDn(im, nlevs, filt) 15 | 16 | %------------------------------------------------------------ 17 | %% OPTIONAL ARGS: 18 | 19 | if (exist('nlevs') ~= 1) 20 | nlevs = 1; 21 | end 22 | 23 | if (exist('filt') ~= 1) 24 | filt = 'binom5'; 25 | end 26 | 27 | %------------------------------------------------------------ 28 | 29 | if isstr(filt) 30 | filt = namedFilter(filt); 31 | end 32 | 33 | filt = filt/sum(filt(:)); 34 | 35 | if nlevs > 1 36 | im = blurDn(im,nlevs-1,filt); 37 | end 38 | 39 | if (nlevs >= 1) 40 | if (any(size(im)==1)) 41 | if (~any(size(filt)==1)) 42 | error('Cant apply 2D filter to 1D signal'); 43 | end 44 | if (size(im,2)==1) 45 | filt = filt(:); 46 | else 47 | filt = filt(:)'; 48 | end 49 | res = corrDn(im,filt,'reflect1',(size(im)~=1)+1); 50 | elseif (any(size(filt)==1)) 51 | filt = filt(:); 52 | res = corrDn(im,filt,'reflect1',[2 1]); 53 | res = corrDn(res,filt','reflect1',[1 2]); 54 | else 55 | res = corrDn(im,filt,'reflect1',[2 2]); 56 | end 57 | else 58 | res = im; 59 | end 60 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/buildGpyr.m: -------------------------------------------------------------------------------- 1 | % [PYR, INDICES] = buildGpyr(IM, HEIGHT, FILT, EDGES) 2 | % 3 | % Construct a Gaussian pyramid on matrix IM. 4 | % 5 | % HEIGHT (optional) specifies the number of pyramid levels to build. Default 6 | % is 1+maxPyrHt(size(IM),size(FILT)). 7 | % You can also specify 'auto' to use this value. 8 | % 9 | % FILT (optional) can be a string naming a standard filter (see 10 | % namedFilter), or a vector which will be used for (separable) 11 | % convolution. Default = 'binom5'. EDGES specifies edge-handling, and 12 | % defaults to 'reflect1' (see corrDn). 13 | % 14 | % PYR is a vector containing the N pyramid subbands, ordered from fine 15 | % to coarse. INDICES is an Nx2 matrix containing the sizes of 16 | % each subband. This is compatible with the MatLab Wavelet toolbox. 17 | 18 | % Eero Simoncelli, 6/96. 19 | 20 | function [pyr,pind] = buildGpyr(im, ht, filt, edges) 21 | 22 | if (nargin < 1) 23 | error('First argument (IM) is required'); 24 | end 25 | 26 | im_sz = size(im); 27 | 28 | %------------------------------------------------------------ 29 | %% OPTIONAL ARGS: 30 | 31 | if (exist('filt') ~= 1) 32 | filt = 'binom5'; 33 | end 34 | 35 | if isstr(filt) 36 | filt = namedFilter(filt); 37 | end 38 | 39 | if ( (size(filt,1) > 1) & (size(filt,2) > 1) ) 40 | error('FILT should be a 1D filter (i.e., a vector)'); 41 | else 42 | filt = filt(:); 43 | end 44 | 45 | max_ht = 1 + maxPyrHt(im_sz, size(filt,1)); 46 | if ( (exist('ht') ~= 1) | (ht == 'auto') ) 47 | ht = max_ht; 48 | else 49 | if (ht > max_ht) 50 | error(sprintf('Cannot build pyramid higher than %d levels.',max_ht)); 51 | end 52 | end 53 | 54 | if (exist('edges') ~= 1) 55 | edges= 'reflect1'; 56 | end 57 | 58 | %------------------------------------------------------------ 59 | 60 | if (ht <= 1) 61 | 62 | pyr = im(:); 63 | pind = im_sz; 64 | 65 | else 66 | 67 | if (im_sz(2) == 1) 68 | lo2 = corrDn(im, filt, edges, [2 1], [1 1]); 69 | elseif (im_sz(1) == 1) 70 | lo2 = corrDn(im, filt', edges, [1 2], [1 1]); 71 | else 72 | lo = corrDn(im, filt', edges, [1 2], [1 1]); 73 | lo2 = corrDn(lo, filt, edges, [2 1], [1 1]); 74 | end 75 | 76 | [npyr,nind] = buildGpyr(lo2, ht-1, filt, edges); 77 | 78 | pyr = [im(:); npyr]; 79 | pind = [im_sz; nind]; 80 | 81 | end 82 | 83 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/buildSCFpyr.m: -------------------------------------------------------------------------------- 1 | % [PYR, INDICES, STEERMTX, HARMONICS] = buildSCFpyr(IM, HEIGHT, ORDER, TWIDTH) 2 | % 3 | % This is a modified version of buildSFpyr, that constructs a 4 | % complex-valued steerable pyramid using Hilbert-transform pairs 5 | % of filters. Note that the imaginary parts will *not* be steerable. 6 | % 7 | % To reconstruct from this representation, either call reconSFpyr 8 | % on the real part of the pyramid, *or* call reconSCFpyr which will 9 | % use both real and imaginary parts (forcing analyticity). 10 | % 11 | % Description of this transform appears in: Portilla & Simoncelli, 12 | % Int'l Journal of Computer Vision, 40(1):49-71, Oct 2000. 13 | % Further information: http://www.cns.nyu.edu/~eero/STEERPYR/ 14 | 15 | % Original code: Eero Simoncelli, 5/97. 16 | % Modified by Javier Portilla to return complex (quadrature pair) channels, 17 | % 9/97. 18 | 19 | function [pyr,pind,steermtx,harmonics] = buildSCFpyr(im, ht, order, twidth) 20 | 21 | %----------------------------------------------------------------- 22 | %% DEFAULTS: 23 | 24 | max_ht = floor(log2(min(size(im)))) - 2; 25 | 26 | if (exist('ht') ~= 1) 27 | ht = max_ht; 28 | else 29 | if (ht > max_ht) 30 | error(sprintf('Cannot build pyramid higher than %d levels.',max_ht)); 31 | end 32 | end 33 | 34 | if (exist('order') ~= 1) 35 | order = 3; 36 | elseif ((order > 15) | (order < 0)) 37 | fprintf(1,'Warning: ORDER must be an integer in the range [0,15]. Truncating.\n'); 38 | order = min(max(order,0),15); 39 | else 40 | order = round(order); 41 | end 42 | nbands = order+1; 43 | 44 | if (exist('twidth') ~= 1) 45 | twidth = 1; 46 | elseif (twidth <= 0) 47 | fprintf(1,'Warning: TWIDTH must be positive. Setting to 1.\n'); 48 | twidth = 1; 49 | end 50 | 51 | %----------------------------------------------------------------- 52 | %% Steering stuff: 53 | 54 | if (mod((nbands),2) == 0) 55 | harmonics = [0:(nbands/2)-1]'*2 + 1; 56 | else 57 | harmonics = [0:(nbands-1)/2]'*2; 58 | end 59 | 60 | steermtx = steer2HarmMtx(harmonics, pi*[0:nbands-1]/nbands, 'even'); 61 | 62 | %----------------------------------------------------------------- 63 | 64 | dims = size(im); 65 | ctr = ceil((dims+0.5)/2); 66 | 67 | [xramp,yramp] = meshgrid( ([1:dims(2)]-ctr(2))./(dims(2)/2), ... 68 | ([1:dims(1)]-ctr(1))./(dims(1)/2) ); 69 | angle = atan2(yramp,xramp); 70 | log_rad = sqrt(xramp.^2 + yramp.^2); 71 | log_rad(ctr(1),ctr(2)) = log_rad(ctr(1),ctr(2)-1); 72 | log_rad = log2(log_rad); 73 | 74 | %% Radial transition function (a raised cosine in log-frequency): 75 | [Xrcos,Yrcos] = rcosFn(twidth,(-twidth/2),[0 1]); 76 | Yrcos = sqrt(Yrcos); 77 | 78 | YIrcos = sqrt(1.0 - Yrcos.^2); 79 | lo0mask = pointOp(log_rad, YIrcos, Xrcos(1), Xrcos(2)-Xrcos(1), 0); 80 | imdft = fftshift(fft2(im)); 81 | lo0dft = imdft .* lo0mask; 82 | 83 | [pyr,pind] = buildSCFpyrLevs(lo0dft, log_rad, Xrcos, Yrcos, angle, ht, nbands); 84 | 85 | hi0mask = pointOp(log_rad, Yrcos, Xrcos(1), Xrcos(2)-Xrcos(1), 0); 86 | hi0dft = imdft .* hi0mask; 87 | hi0 = ifft2(ifftshift(hi0dft)); 88 | 89 | pyr = [real(hi0(:)) ; pyr]; 90 | pind = [size(hi0); pind]; 91 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/buildSCFpyrLevs.m: -------------------------------------------------------------------------------- 1 | % [PYR, INDICES] = buildSCFpyrLevs(LODFT, LOGRAD, XRCOS, YRCOS, ANGLE, HEIGHT, NBANDS) 2 | % 3 | % Recursive function for constructing levels of a steerable pyramid. This 4 | % is called by buildSCFpyr, and is not usually called directly. 5 | 6 | % Original code: Eero Simoncelli, 5/97. 7 | % Modified by Javier Portilla to generate complex bands in 9/97. 8 | 9 | function [pyr,pind] = buildSCFpyrLevs(lodft,log_rad,Xrcos,Yrcos,angle,ht,nbands); 10 | 11 | if (ht <= 0) 12 | 13 | lo0 = ifft2(ifftshift(lodft)); 14 | pyr = real(lo0(:)); 15 | pind = size(lo0); 16 | 17 | else 18 | 19 | bands = zeros(prod(size(lodft)), nbands); 20 | bind = zeros(nbands,2); 21 | 22 | % log_rad = log_rad + 1; 23 | Xrcos = Xrcos - log2(2); % shift origin of lut by 1 octave. 24 | 25 | lutsize = 1024; 26 | Xcosn = pi*[-(2*lutsize+1):(lutsize+1)]/lutsize; % [-2*pi:pi] 27 | order = nbands-1; 28 | %% divide by sqrt(sum_(n=0)^(N-1) cos(pi*n/N)^(2(N-1)) ) 29 | %% Thanks to Patrick Teo for writing this out :) 30 | const = (2^(2*order))*(factorial(order)^2)/(nbands*factorial(2*order)); 31 | 32 | % 33 | % Ycosn = sqrt(const) * (cos(Xcosn)).^order; 34 | % 35 | % analityc version: only take one lobe 36 | alfa= mod(pi+Xcosn,2*pi)-pi; 37 | Ycosn = 2*sqrt(const) * (cos(Xcosn).^order) .* (abs(alfa) max_ht) 49 | error(sprintf('Cannot build pyramid higher than %d levels.',max_ht)); 50 | end 51 | end 52 | 53 | %----------------------------------------------------------------- 54 | 55 | hi0 = corrDn(im, hi0filt, edges); 56 | lo0 = corrDn(im, lo0filt, edges); 57 | 58 | [pyr,pind] = buildSpyrLevs(lo0, ht, lofilt, bfilts, edges); 59 | 60 | pyr = [hi0(:) ; pyr]; 61 | pind = [size(hi0); pind]; 62 | 63 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/buildSpyrLevs.m: -------------------------------------------------------------------------------- 1 | % [PYR, INDICES] = buildSpyrLevs(LOIM, HEIGHT, LOFILT, BFILTS, EDGES) 2 | % 3 | % Recursive function for constructing levels of a steerable pyramid. This 4 | % is called by buildSpyr, and is not usually called directly. 5 | 6 | % Eero Simoncelli, 6/96. 7 | 8 | function [pyr,pind] = buildSpyrLevs(lo0,ht,lofilt,bfilts,edges); 9 | 10 | if (ht <= 0) 11 | 12 | pyr = lo0(:); 13 | pind = size(lo0); 14 | 15 | else 16 | 17 | % Assume square filters: 18 | bfiltsz = round(sqrt(size(bfilts,1))); 19 | 20 | bands = zeros(prod(size(lo0)),size(bfilts,2)); 21 | bind = zeros(size(bfilts,2),2); 22 | 23 | for b = 1:size(bfilts,2) 24 | filt = reshape(bfilts(:,b),bfiltsz,bfiltsz); 25 | band = corrDn(lo0, filt, edges); 26 | bands(:,b) = band(:); 27 | bind(b,:) = size(band); 28 | end 29 | 30 | lo = corrDn(lo0, lofilt, edges, [2 2], [1 1]); 31 | 32 | [npyr,nind] = buildSpyrLevs(lo, ht-1, lofilt, bfilts, edges); 33 | 34 | pyr = [bands(:); npyr]; 35 | pind = [bind; nind]; 36 | 37 | end 38 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/cconv2.m: -------------------------------------------------------------------------------- 1 | % RES = CCONV2(MTX1, MTX2, CTR) 2 | % 3 | % Circular convolution of two matrices. Result will be of size of 4 | % LARGER vector. 5 | % 6 | % The origin of the smaller matrix is assumed to be its center. 7 | % For even dimensions, the origin is determined by the CTR (optional) 8 | % argument: 9 | % CTR origin 10 | % 0 DIM/2 (default) 11 | % 1 (DIM/2)+1 12 | 13 | % Eero Simoncelli, 6/96. Modified 2/97. 14 | 15 | function c = cconv2(a,b,ctr) 16 | 17 | if (exist('ctr') ~= 1) 18 | ctr = 0; 19 | end 20 | 21 | if (( size(a,1) >= size(b,1) ) & ( size(a,2) >= size(b,2) )) 22 | large = a; small = b; 23 | elseif (( size(a,1) <= size(b,1) ) & ( size(a,2) <= size(b,2) )) 24 | large = b; small = a; 25 | else 26 | error('one arg must be larger than the other in both dimensions!'); 27 | end 28 | 29 | ly = size(large,1); 30 | lx = size(large,2); 31 | sy = size(small,1); 32 | sx = size(small,2); 33 | 34 | %% These values are the index of the small mtx that falls on the 35 | %% border pixel of the large matrix when computing the first 36 | %% convolution response sample: 37 | sy2 = floor((sy+ctr+1)/2); 38 | sx2 = floor((sx+ctr+1)/2); 39 | 40 | % pad: 41 | clarge = [ ... 42 | large(ly-sy+sy2+1:ly,lx-sx+sx2+1:lx), large(ly-sy+sy2+1:ly,:), ... 43 | large(ly-sy+sy2+1:ly,1:sx2-1); ... 44 | large(:,lx-sx+sx2+1:lx), large, large(:,1:sx2-1); ... 45 | large(1:sy2-1,lx-sx+sx2+1:lx), ... 46 | large(1:sy2-1,:), ... 47 | large(1:sy2-1,1:sx2-1) ]; 48 | 49 | c = conv2(clarge,small,'valid'); 50 | 51 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/clip.m: -------------------------------------------------------------------------------- 1 | % [RES] = clip(IM, MINVALorRANGE, MAXVAL) 2 | % 3 | % Clip values of matrix IM to lie between minVal and maxVal: 4 | % RES = max(min(IM,MAXVAL),MINVAL) 5 | % The first argument can also specify both min and max, as a 2-vector. 6 | % If only one argument is passed, the range defaults to [0,1]. 7 | 8 | function res = clip(im, minValOrRange, maxVal) 9 | 10 | if (exist('minValOrRange') ~= 1) 11 | minVal = 0; 12 | maxVal = 1; 13 | elseif (length(minValOrRange) == 2) 14 | minVal = minValOrRange(1); 15 | maxVal = minValOrRange(2); 16 | elseif (length(minValOrRange) == 1) 17 | minVal = minValOrRange; 18 | if (exist('maxVal') ~= 1) 19 | maxVal=minVal+1; 20 | end 21 | else 22 | error('MINVAL must be a scalar or a 2-vector'); 23 | end 24 | 25 | if ( maxVal < minVal ) 26 | error('MAXVAL should be less than MINVAL'); 27 | end 28 | 29 | res = im; 30 | res(find(im < minVal)) = minVal; 31 | res(find(im > maxVal)) = maxVal; 32 | 33 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/corrDn.m: -------------------------------------------------------------------------------- 1 | % RES = corrDn(IM, FILT, EDGES, STEP, START, STOP) 2 | % 3 | % Compute correlation of matrices IM with FILT, followed by 4 | % downsampling. These arguments should be 1D or 2D matrices, and IM 5 | % must be larger (in both dimensions) than FILT. The origin of filt 6 | % is assumed to be floor(size(filt)/2)+1. 7 | % 8 | % EDGES is a string determining boundary handling: 9 | % 'circular' - Circular convolution 10 | % 'reflect1' - Reflect about the edge pixels 11 | % 'reflect2' - Reflect, doubling the edge pixels 12 | % 'repeat' - Repeat the edge pixels 13 | % 'zero' - Assume values of zero outside image boundary 14 | % 'extend' - Reflect and invert (continuous values and derivs) 15 | % 'dont-compute' - Zero output when filter overhangs input boundaries 16 | % 17 | % Downsampling factors are determined by STEP (optional, default=[1 1]), 18 | % which should be a 2-vector [y,x]. 19 | % 20 | % The window over which the convolution occurs is specfied by START 21 | % (optional, default=[1,1], and STOP (optional, default=size(IM)). 22 | % 23 | % NOTE: this operation corresponds to multiplication of a signal 24 | % vector by a matrix whose rows contain copies of the FILT shifted by 25 | % multiples of STEP. See upConv.m for the operation corresponding to 26 | % the transpose of this matrix. 27 | 28 | % Eero Simoncelli, 6/96, revised 2/97. 29 | 30 | function res = corrDn(im, filt, edges, step, start, stop) 31 | 32 | %% NOTE: THIS CODE IS NOT ACTUALLY USED! (MEX FILE IS CALLED INSTEAD) 33 | 34 | fprintf(1,'WARNING: You should compile the MEX version of "corrDn.c",\n found in the MEX subdirectory of matlabPyrTools, and put it in your matlab path. It is MUCH faster, and provides more boundary-handling options.\n'); 35 | 36 | %------------------------------------------------------------ 37 | %% OPTIONAL ARGS: 38 | 39 | if (exist('edges') == 1) 40 | if (strcmp(edges,'reflect1') ~= 1) 41 | warning('Using REFLECT1 edge-handling (use MEX code for other options).'); 42 | end 43 | end 44 | 45 | if (exist('step') ~= 1) 46 | step = [1,1]; 47 | end 48 | 49 | if (exist('start') ~= 1) 50 | start = [1,1]; 51 | end 52 | 53 | if (exist('stop') ~= 1) 54 | stop = size(im); 55 | end 56 | 57 | %------------------------------------------------------------ 58 | 59 | % Reverse order of taps in filt, to do correlation instead of convolution 60 | filt = filt(size(filt,1):-1:1,size(filt,2):-1:1); 61 | 62 | tmp = rconv2(im,filt); 63 | res = tmp(start(1):step(1):stop(1),start(2):step(2):stop(2)); 64 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/corrDn.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/corrDn.mexa64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/corrDn.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/corrDn.mexglx -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/corrDn.mexmac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/corrDn.mexmac -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/corrDn.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/corrDn.mexmaci64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/corrDn.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/corrDn.mexw32 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/einstein.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/einstein.pgm -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/entropy2.m: -------------------------------------------------------------------------------- 1 | % E = ENTROPY2(MTX,BINSIZE) 2 | % 3 | % Compute the first-order sample entropy of MTX. Samples of VEC are 4 | % first discretized. Optional argument BINSIZE controls the 5 | % discretization, and defaults to 256/(max(VEC)-min(VEC)). 6 | % 7 | % NOTE: This is a heavily biased estimate of entropy (it is too 8 | % small) when you don't have much data! 9 | 10 | % Eero Simoncelli, 6/96. 11 | 12 | function res = entropy2(mtx,binsize) 13 | 14 | %% Ensure it's a vector, not a matrix. 15 | vec = mtx(:); 16 | [mn,mx] = range2(vec); 17 | 18 | if (exist('binsize') == 1) 19 | nbins = max((mx-mn)/binsize, 1); 20 | else 21 | nbins = 256; 22 | end 23 | 24 | [bincount,bins] = histo(vec,nbins); 25 | 26 | %% Collect non-zero bins: 27 | H = bincount(find(bincount)); 28 | H = H/sum(H); 29 | 30 | res = -sum(H .* log2(H)); 31 | 32 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/factorial.m: -------------------------------------------------------------------------------- 1 | %% RES = factorial(NUM) 2 | % 3 | % Factorial function that works on matrices (matlab's does not). 4 | 5 | % EPS, 11/02 6 | 7 | function res = factorial(num) 8 | 9 | res = ones(size(num)); 10 | 11 | ind = find(num > 0); 12 | if ( ~isempty(ind) ) 13 | subNum = num(ind); 14 | res(ind) = subNum .* factorial(subNum-1); 15 | end 16 | 17 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/feynman.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/feynman.pgm -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/histo.m: -------------------------------------------------------------------------------- 1 | % [N,X] = histo(MTX, nbinsOrBinsize, binCenter); 2 | % 3 | % Compute a histogram of (all) elements of MTX. N contains the histogram 4 | % counts, X is a vector containg the centers of the histogram bins. 5 | % 6 | % nbinsOrBinsize (optional, default = 101) specifies either 7 | % the number of histogram bins, or the negative of the binsize. 8 | % 9 | % binCenter (optional, default = mean2(MTX)) specifies a center position 10 | % for (any one of) the histogram bins. 11 | % 12 | % How does this differ from MatLab's HIST function? This function: 13 | % - allows uniformly spaced bins only. 14 | % +/- operates on all elements of MTX, instead of columnwise. 15 | % + is much faster (approximately a factor of 80 on my machine). 16 | % + allows specification of number of bins OR binsize. Default=101 bins. 17 | % + allows (optional) specification of binCenter. 18 | 19 | % Eero Simoncelli, 3/97. 20 | 21 | function [N, X] = histo(mtx, nbins, binCtr) 22 | 23 | %% NOTE: THIS CODE IS NOT ACTUALLY USED! (MEX FILE IS CALLED INSTEAD) 24 | 25 | fprintf(1,'WARNING: You should compile the MEX version of "histo.c",\n found in the MEX subdirectory of matlabPyrTools, and put it in your matlab path. It is MUCH faster.\n'); 26 | 27 | mtx = mtx(:); 28 | 29 | %------------------------------------------------------------ 30 | %% OPTIONAL ARGS: 31 | 32 | [mn,mx] = range2(mtx); 33 | 34 | if (exist('binCtr') ~= 1) 35 | binCtr = mean(mtx); 36 | end 37 | 38 | if (exist('nbins') == 1) 39 | if (nbins < 0) 40 | binSize = -nbins; 41 | else 42 | binSize = ((mx-mn)/nbins); 43 | tmpNbins = round((mx-binCtr)/binSize) - round((mn-binCtr)/binSize); 44 | if (tmpNbins ~= nbins) 45 | warning('Using %d bins instead of requested number (%d)',tmpNbins,nbins); 46 | end 47 | end 48 | else 49 | binSize = ((mx-mn)/101); 50 | end 51 | 52 | firstBin = binCtr + binSize*round( (mn-binCtr)/binSize ); 53 | 54 | tmpNbins = round((mx-binCtr)/binSize) - round((mn-binCtr)/binSize); 55 | 56 | bins = firstBin + binSize*[0:tmpNbins]; 57 | 58 | [N, X] = hist(mtx, bins); 59 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/histo.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/histo.mexa64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/histo.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/histo.mexglx -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/histo.mexmac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/histo.mexmac -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/histo.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/histo.mexmaci64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/histo.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/histo.mexw32 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/histoMatch.m: -------------------------------------------------------------------------------- 1 | % RES = histoMatch(MTX, N, X) 2 | % 3 | % Modify elements of MTX so that normalized histogram matches that 4 | % specified by vectors X and N, where N contains the histogram counts 5 | % and X the histogram bin positions (see histo). 6 | 7 | % Eero Simoncelli, 7/96. 8 | 9 | function res = histoMatch(mtx, N, X) 10 | 11 | if ( exist('histo') == 3 ) 12 | [oN, oX] = histo(mtx(:), size(X(:),1)); 13 | else 14 | [oN, oX] = hist(mtx(:), size(X(:),1)); 15 | end 16 | 17 | oStep = oX(2) - oX(1); 18 | oC = [0, cumsum(oN)]/sum(oN); 19 | oX = [oX(1)-oStep/2, oX+oStep/2]; 20 | 21 | N = N(:)'; 22 | X = X(:)'; 23 | N = N + mean(N)/(1e8); %% HACK: no empty bins ensures nC strictly monotonic 24 | 25 | nStep = X(2) - X(1); 26 | nC = [0, cumsum(N)]/sum(N); 27 | nX = [X(1)-nStep/2, X+nStep/2]; 28 | 29 | nnX = interp1(nC, nX, oC, 'linear'); 30 | 31 | if ( exist('pointOp') == 3 ) 32 | res = pointOp(mtx, nnX, oX(1), oStep); 33 | else 34 | res = reshape(interp1(oX, nnX, mtx(:)),size(mtx,1),size(mtx,2)); 35 | end 36 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/imGradient.m: -------------------------------------------------------------------------------- 1 | % [dx, dy] = imGradient(im, edges) 2 | % 3 | % Compute the gradient of the image using smooth derivative filters 4 | % optimized for accurate direction estimation. Coordinate system 5 | % corresponds to standard pixel indexing: X axis points rightward. Y 6 | % axis points downward. EDGES specify boundary handling (see corrDn 7 | % for options). 8 | % 9 | % Unlike matlab's new gradient function, which is based on local 10 | % differences, this function computes derivatives using 5x5 filters 11 | % designed to accurately reflect the local orientation content. 12 | 13 | % EPS, 1997. 14 | % original filters from Int'l Conf Image Processing, 1994. 15 | % updated filters 10/2003: see Farid & Simoncelli, IEEE Trans Image Processing, 13(4):496-508, April 2004. 16 | % Incorporated into matlabPyrTools 10/2004. 17 | 18 | function [dx, dy] = imGradient(im, edges) 19 | 20 | if (exist('edges') ~= 1) 21 | edges = 'dont-compute'; 22 | end 23 | 24 | %% kernels from Farid & Simoncelli, IEEE Trans Image Processing, 13(4):496-508, April 2004. 25 | gp = [0.037659 0.249153 0.426375 0.249153 0.037659]'; 26 | gd = [-0.109604 -0.276691 0.000000 0.276691 0.109604]'; 27 | 28 | dx = corrDn(corrDn(im, gp, edges), gd', edges); 29 | dy = corrDn(corrDn(im, gd, edges), gp', edges); 30 | 31 | return 32 | 33 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 34 | %%% TEST: 35 | 36 | %%Make a ramp with random slope and direction 37 | dir = 2*pi*rand - pi; 38 | slope = 10*rand; 39 | 40 | sz = 32 41 | im = mkRamp(sz, dir, slope); 42 | [dx,dy] = imGradient(im); 43 | showIm(dx + sqrt(-1)*dy); 44 | 45 | ctr = (sz*sz/2)+sz/2; 46 | slopeEst = sqrt(dx(ctr).^2 + dy(ctr).^2); 47 | dirEst = atan2(dy(ctr), dx(ctr)); 48 | 49 | [slope, slopeEst] 50 | [dir, dirEst] 51 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/imStats.m: -------------------------------------------------------------------------------- 1 | % imStats(IM1,IM2) 2 | % 3 | % Report image (matrix) statistics. 4 | % When called on a single image IM1, report min, max, mean, stdev, skew, 5 | % and kurtosis (4th moment about the mean, divided by squared variance) 6 | % 7 | % When called on two images (IM1 and IM2), report min, max, mean, 8 | % stdev of the difference, and also SNR (relative to IM1). 9 | 10 | % Eero Simoncelli, 6/96. 11 | 12 | function [] = imStats(im1,im2) 13 | 14 | if (~isreal(im1)) 15 | error('Args must be real-valued matrices'); 16 | end 17 | 18 | if (exist('im2') == 1) 19 | difference = im1 - im2; 20 | [mn,mx] = range2(difference); 21 | mean = mean2(difference); 22 | v = var2(difference,mean); 23 | if (v < realmin) 24 | snr = Inf; 25 | else 26 | snr = 10 * log10(var2(im1)/v); 27 | end 28 | fprintf(1, 'Difference statistics:\n'); 29 | fprintf(1, ' Range: [%c, %c]\n',mn,mx); 30 | fprintf(1, ' Mean: %f, Stdev (rmse): %f, SNR (dB): %f\n',... 31 | mean,sqrt(v),snr); 32 | else 33 | [mn,mx] = range2(im1); 34 | mean = mean2(im1); 35 | var = var2(im1,mean); 36 | stdev = sqrt(real(var))+sqrt(imag(var)); 37 | sk = skew2(im1, mean, stdev^2); 38 | kurt = kurt2(im1, mean, stdev^2); 39 | fprintf(1, 'Image statistics:\n'); 40 | fprintf(1, ' Range: [%f, %f]\n',mn,mx); 41 | fprintf(1, ' Mean: %f, Stdev: %f, Skew: %f, Kurt: %f\n',mean,stdev,sk,kurt); 42 | end 43 | 44 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/ind2wtree.m: -------------------------------------------------------------------------------- 1 | function wtree = ind2wtree(pyr, ind) 2 | 3 | %this function is called by vifvec.m 4 | % converts the output of Eero Simoncelli's pyramid routines into subbands in a cell array 5 | C=pyr; 6 | S=ind; 7 | 8 | offset=0; 9 | numsubs=size(ind,1); 10 | for i=1:numsubs 11 | wtree{numsubs-i+1}=reshape(C(offset+1:offset+prod(S(i,:))), S(i,1),S(i,2)); 12 | offset=offset+prod(S(i,:)); 13 | end 14 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/innerProd.m: -------------------------------------------------------------------------------- 1 | % RES = innerProd(MTX) 2 | % 3 | % Compute (MTX' * MTX) efficiently (i.e., without copying the matrix) 4 | % 5 | % NOTE: This function used to call a MEX function (C code) to avoid copying, but 6 | % newer versions of matlab have eliminated the overhead of the 7 | % simpler form below. 8 | 9 | function res = innerProd(mtx) 10 | 11 | res = mtx' * mtx; 12 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/kurt2.m: -------------------------------------------------------------------------------- 1 | % K = KURT2(MTX,MEAN,VAR) 2 | % 3 | % Sample kurtosis (fourth moment divided by squared variance) 4 | % of a matrix. Kurtosis of a Gaussian distribution is 3. 5 | % MEAN (optional) and VAR (optional) make the computation faster. 6 | 7 | % Eero Simoncelli, 6/96. 8 | 9 | function res = kurt2(mtx, mn, v) 10 | 11 | if (exist('mn') ~= 1) 12 | mn = mean(mean(mtx)); 13 | end 14 | 15 | if (exist('v') ~= 1) 16 | v = var2(mtx,mn); 17 | end 18 | 19 | if (isreal(mtx)) 20 | res = mean(mean(abs(mtx-mn).^4)) / (v^2); 21 | else 22 | res = mean(mean(real(mtx-mn).^4)) / (real(v)^2) + ... 23 | i*mean(mean(imag(mtx-mn).^4)) / (imag(v)^2); 24 | end 25 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/lplot.m: -------------------------------------------------------------------------------- 1 | % lplot(VEC, XRANGE) 2 | % 3 | % Plot VEC, a vector, in "lollipop" format. 4 | % XRANGE (optional, default = [1,length(VEC)]), should be a 2-vector 5 | % specifying the X positions (for labeling purposes) of the first and 6 | % last sample of VEC. 7 | 8 | % Mark Liberman, Linguistics Dept, UPenn, 1994. 9 | 10 | function lplot(x,xrange) 11 | 12 | if (exist('xrange') ~= 1) 13 | xrange = [1,length(x)]; 14 | end 15 | 16 | msize = size(x); 17 | if ( msize(2) == 1) 18 | x = x'; 19 | elseif (msize(1) ~= 1) 20 | error('First arg must be a vector'); 21 | end 22 | 23 | if (~isreal(x)) 24 | fprintf(1,'Warning: Imaginary part of signal ignored\n'); 25 | x = abs(x); 26 | end 27 | 28 | N = length(x); 29 | index = xrange(1) + (xrange(2)-xrange(1))*[0:(N-1)]/(N-1); 30 | xinc = index(2)-index(1); 31 | 32 | xx = [zeros(1,N);x;zeros(1,N)]; 33 | indexis = [index;index;index]; 34 | xdiscrete = [0 xx(:)' 0]; 35 | idiscrete = [index(1)-xinc indexis(:)' index(N)+xinc]; 36 | 37 | [mn,mx] = range2(xdiscrete); 38 | ypad = (mx-mn)/12; % MAGIC NUMBER: graph padding 39 | 40 | plot(idiscrete, xdiscrete, index, x, 'o'); 41 | axis([index(1)-xinc, index(N)+xinc, mn-ypad, mx+ypad]); 42 | 43 | return 44 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/lpyrHt.m: -------------------------------------------------------------------------------- 1 | % [HEIGHT] = lpyrHt(INDICES) 2 | % 3 | % Compute height of Laplacian pyramid with given its INDICES matrix. 4 | % See buildLpyr.m 5 | 6 | % Eero Simoncelli, 6/96. 7 | 8 | function [ht] = lpyrHt(pind) 9 | 10 | % Don't count lowpass residual band 11 | ht = size(pind,1)-1; 12 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/make-tar-file: -------------------------------------------------------------------------------- 1 | #!/bin/csh -f 2 | 3 | setenv BASENAME "/lcv/matlab/lib/" 4 | 5 | setenv DIRNAME "matlabPyrTools" 6 | setenv TARFILE "matlabPyrTools.tar" 7 | 8 | # For MAC: 9 | # Put Macintosh-MEX.sit.hqx (contains projects, C code, mex files) inside of 10 | # MEX directory. 11 | # Put matlabPyrTools.sit.hqx (entire distribution, filetype corrected, no 12 | # MEX subdirectory) inside of main directory. 13 | 14 | #################################################################### 15 | ## Make a compressed tar file of the EPS_matlab directory: 16 | 17 | echo "Before making the tar file:" 18 | echo "1) If C code is modified, re-make the mex files..." 19 | echo "2) Put correct date and version number in Contents.m. Execute 'ver' to test" 20 | echo "3) add a ChangeLog entry stating that new tarfile was generated" 21 | sleep 5 22 | 23 | pushd ${BASENAME} 24 | 25 | #echo "Removing old tarfile..." 26 | #/bin/rm "${DIRNAME}/${TARFILE}" 27 | #/bin/rm "${DIRNAME}/${TARFILE}.gz" 28 | 29 | #echo "Removing ${DIRNAME}/MEX/*.o files..." 30 | #/bin/rm ${DIRNAME}/MEX/*.o 31 | 32 | echo "Creating ${DIRNAME}/${TARFILE} ..." 33 | 34 | tar -cvf ${DIRNAME}/${TARFILE} \ 35 | ${DIRNAME}/README ${DIRNAME}/ChangeLog ${DIRNAME}/*.m \ 36 | ${DIRNAME}/MEX \ 37 | ${DIRNAME}/TUTORIALS/README ${DIRNAME}/TUTORIALS/*.m \ 38 | ${DIRNAME}/*.pgm 39 | 40 | echo "G'zipping ${DIRNAME}/${TARFILE} ..." 41 | 42 | gzip ${DIRNAME}/$TARFILE 43 | gls -l "${DIRNAME}/$TARFILE.gz" 44 | 45 | popd 46 | 47 | echo "Done. Now:" 48 | echo " cd ${BASENAME}/${DIRNAME}" 49 | echo " scp ${TARFILE}.gz hopf:/Library/WebServer/Documents-www/ftp/eero/" 50 | echo " cp README /users/eero/html_public/matlabPyrTools.README" 51 | echo " cp ChangeLog /users/eero/html_public/matlabPyrTools.ChangeLog" 52 | echo " cp Contents.m /users/eero/html_public/matlabPyrTools-Contents.m" 53 | echo "" 54 | echo " Finally, mark as updated in ~lcv/html_public/software.html" 55 | echo "" 56 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/maxPyrHt.m: -------------------------------------------------------------------------------- 1 | % HEIGHT = maxPyrHt(IMSIZE, FILTSIZE) 2 | % 3 | % Compute maximum pyramid height for given image and filter sizes. 4 | % Specifically: the number of corrDn operations that can be sequentially 5 | % performed when subsampling by a factor of 2. 6 | 7 | % Eero Simoncelli, 6/96. 8 | 9 | function height = maxPyrHt(imsz, filtsz) 10 | 11 | imsz = imsz(:); 12 | filtsz = filtsz(:); 13 | 14 | if any(imsz == 1) % 1D image 15 | imsz = prod(imsz); 16 | filtsz = prod(filtsz); 17 | elseif any(filtsz == 1) % 2D image, 1D filter 18 | filtsz = [filtsz(1); filtsz(1)]; 19 | end 20 | 21 | if any(imsz < filtsz) 22 | height = 0; 23 | else 24 | height = 1 + maxPyrHt( floor(imsz/2), filtsz ); 25 | end 26 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/mean2.m: -------------------------------------------------------------------------------- 1 | % M = MEAN2(MTX) 2 | % 3 | % Sample mean of a matrix. 4 | 5 | function res = mean2(mtx) 6 | 7 | res = mean(mean(mtx)); 8 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/mkAngle.m: -------------------------------------------------------------------------------- 1 | % IM = mkAngle(SIZE, PHASE, ORIGIN) 2 | % 3 | % Compute a matrix of dimension SIZE (a [Y X] 2-vector, or a scalar) 4 | % containing samples of the polar angle (in radians, CW from the 5 | % X-axis, ranging from -pi to pi), relative to angle PHASE (default = 6 | % 0), about ORIGIN pixel (default = (size+1)/2). 7 | 8 | % Eero Simoncelli, 6/96. 9 | 10 | function [res] = mkAngle(sz, phase, origin) 11 | 12 | sz = sz(:); 13 | if (size(sz,1) == 1) 14 | sz = [sz,sz]; 15 | end 16 | 17 | % ----------------------------------------------------------------- 18 | % OPTIONAL args: 19 | 20 | if (exist('origin') ~= 1) 21 | origin = (sz+1)/2; 22 | end 23 | 24 | % ----------------------------------------------------------------- 25 | 26 | [xramp,yramp] = meshgrid( [1:sz(2)]-origin(2), [1:sz(1)]-origin(1) ); 27 | 28 | res = atan2(yramp,xramp); 29 | 30 | if (exist('phase') == 1) 31 | res = mod(res+(pi-phase),2*pi)-pi; 32 | end 33 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/mkAngularSine.m: -------------------------------------------------------------------------------- 1 | % IM = mkAngularSine(SIZE, HARMONIC, AMPL, PHASE, ORIGIN) 2 | % 3 | % Make an angular sinusoidal image: 4 | % AMPL * sin( HARMONIC*theta + PHASE), 5 | % where theta is the angle about the origin. 6 | % SIZE specifies the matrix size, as for zeros(). 7 | % AMPL (default = 1) and PHASE (default = 0) are optional. 8 | 9 | % Eero Simoncelli, 2/97. 10 | 11 | function [res] = mkAngularSine(sz, harmonic, ampl, ph, origin) 12 | 13 | sz = sz(:); 14 | if (size(sz,1) == 1) 15 | sz = [sz,sz]; 16 | end 17 | 18 | mxsz = max(sz(1),sz(2)); 19 | 20 | %------------------------------------------------------------ 21 | %% OPTIONAL ARGS: 22 | 23 | if (exist('harmonic') ~= 1) 24 | harmonic = 1; 25 | end 26 | 27 | if (exist('ampl') ~= 1) 28 | ampl = 1; 29 | end 30 | 31 | if (exist('ph') ~= 1) 32 | ph = 0; 33 | end 34 | 35 | if (exist('origin') ~= 1) 36 | origin = (sz+1)/2; 37 | end 38 | 39 | %------------------------------------------------------------ 40 | 41 | res = ampl * sin(harmonic*mkAngle(sz,ph,origin) + ph); 42 | 43 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/mkDisc.m: -------------------------------------------------------------------------------- 1 | % IM = mkDisc(SIZE, RADIUS, ORIGIN, TWIDTH, VALS) 2 | % 3 | % Make a "disk" image. SIZE specifies the matrix size, as for 4 | % zeros(). RADIUS (default = min(size)/4) specifies the radius of 5 | % the disk. ORIGIN (default = (size+1)/2) specifies the 6 | % location of the disk center. TWIDTH (in pixels, default = 2) 7 | % specifies the width over which a soft threshold transition is made. 8 | % VALS (default = [0,1]) should be a 2-vector containing the 9 | % intensity value inside and outside the disk. 10 | 11 | % Eero Simoncelli, 6/96. 12 | 13 | function [res] = mkDisc(sz, rad, origin, twidth, vals) 14 | 15 | if (nargin < 1) 16 | error('Must pass at least a size argument'); 17 | end 18 | 19 | sz = sz(:); 20 | if (size(sz,1) == 1) 21 | sz = [sz sz]; 22 | end 23 | 24 | %------------------------------------------------------------ 25 | % OPTIONAL ARGS: 26 | 27 | if (exist('rad') ~= 1) 28 | rad = min(sz(1),sz(2))/4; 29 | end 30 | 31 | if (exist('origin') ~= 1) 32 | origin = (sz+1)./2; 33 | end 34 | 35 | if (exist('twidth') ~= 1) 36 | twidth = 2; 37 | end 38 | 39 | if (exist('vals') ~= 1) 40 | vals = [1,0]; 41 | end 42 | 43 | %------------------------------------------------------------ 44 | 45 | res = mkR(sz,1,origin); 46 | 47 | if (abs(twidth) < realmin) 48 | res = vals(2) + (vals(1) - vals(2)) * (res <= rad); 49 | else 50 | [Xtbl,Ytbl] = rcosFn(twidth, rad, [vals(1), vals(2)]); 51 | res = pointOp(res, Ytbl, Xtbl(1), Xtbl(2)-Xtbl(1), 0); 52 | % 53 | % OLD interp1 VERSION: 54 | % res = res(:); 55 | % Xtbl(1) = min(res); 56 | % Xtbl(size(Xtbl,2)) = max(res); 57 | % res = reshape(interp1(Xtbl,Ytbl,res), sz(1), sz(2)); 58 | % 59 | end 60 | 61 | 62 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/mkFract.m: -------------------------------------------------------------------------------- 1 | % IM = mkFract(SIZE, FRACT_DIM) 2 | % 3 | % Make a matrix of dimensions SIZE (a [Y X] 2-vector, or a scalar) 4 | % containing fractal (pink) noise with power spectral density of the 5 | % form: 1/f^(5-2*FRACT_DIM). Image variance is normalized to 1.0. 6 | % FRACT_DIM defaults to 1.0 7 | 8 | % Eero Simoncelli, 6/96. 9 | 10 | %% TODO: Verify that this matches Mandelbrot defn of fractal dimension. 11 | %% Make this more efficient! 12 | 13 | function res = mkFract(dims, fract_dim) 14 | 15 | if (exist('fract_dim') ~= 1) 16 | fract_dim = 1.0; 17 | end 18 | 19 | res = randn(dims); 20 | fres = fft2(res); 21 | 22 | sz = size(res); 23 | ctr = ceil((sz+1)./2); 24 | 25 | shape = ifftshift(mkR(sz, -(2.5-fract_dim), ctr)); 26 | shape(1,1) = 1; %%DC term 27 | 28 | fres = shape .* fres; 29 | fres = ifft2(fres); 30 | 31 | if (max(max(abs(imag(fres)))) > 1e-10) 32 | error('Symmetry error in creating fractal'); 33 | else 34 | res = real(fres); 35 | res = res / sqrt(var2(res)); 36 | end 37 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/mkGaussian.m: -------------------------------------------------------------------------------- 1 | % IM = mkGaussian(SIZE, COVARIANCE, MEAN, AMPLITUDE) 2 | % 3 | % Compute a matrix with dimensions SIZE (a [Y X] 2-vector, or a 4 | % scalar) containing a Gaussian function, centered at pixel position 5 | % specified by MEAN (default = (size+1)/2), with given COVARIANCE (can 6 | % be a scalar, 2-vector, or 2x2 matrix. Default = (min(size)/6)^2), 7 | % and AMPLITUDE. AMPLITUDE='norm' (default) will produce a 8 | % probability-normalized function. All but the first argument are 9 | % optional. 10 | 11 | % Eero Simoncelli, 6/96. 12 | 13 | function [res] = mkGaussian(sz, cov, mn, ampl) 14 | 15 | sz = sz(:); 16 | if (size(sz,1) == 1) 17 | sz = [sz,sz]; 18 | end 19 | 20 | %------------------------------------------------------------ 21 | %% OPTIONAL ARGS: 22 | 23 | if (exist('cov') ~= 1) 24 | cov = (min(sz(1),sz(2))/6)^2; 25 | end 26 | 27 | if ( (exist('mn') ~= 1) | isempty(mn) ) 28 | mn = (sz+1)/2; 29 | else 30 | mn = mn(:); 31 | if (size(mn,1) == 1) 32 | mn = [mn, mn]; 33 | end 34 | end 35 | 36 | if (exist('ampl') ~= 1) 37 | ampl = 'norm'; 38 | end 39 | 40 | %------------------------------------------------------------ 41 | 42 | [xramp,yramp] = meshgrid([1:sz(2)]-mn(2),[1:sz(1)]-mn(1)); 43 | 44 | if (sum(size(cov)) == 2) % scalar 45 | if (strcmp(ampl,'norm')) 46 | ampl = 1/(2*pi*cov(1)); 47 | end 48 | e = (xramp.^2 + yramp.^2)/(-2 * cov); 49 | elseif (sum(size(cov)) == 3) % a 2-vector 50 | if (strcmp(ampl,'norm')) 51 | ampl = 1/(2*pi*sqrt(cov(1)*cov(2))); 52 | end 53 | e = xramp.^2/(-2 * cov(2)) + yramp.^2/(-2 * cov(1)); 54 | else 55 | if (strcmp(ampl,'norm')) 56 | ampl = 1/(2*pi*sqrt(det(cov))); 57 | end 58 | cov = -inv(cov)/2; 59 | e = cov(2,2)*xramp.^2 + (cov(1,2)+cov(2,1))*(xramp.*yramp) ... 60 | + cov(1,1)*yramp.^2; 61 | end 62 | 63 | res = ampl .* exp(e); 64 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/mkImpulse.m: -------------------------------------------------------------------------------- 1 | % IM = mkImpulse(SIZE, ORIGIN, AMPLITUDE) 2 | % 3 | % Compute a matrix of dimension SIZE (a [Y X] 2-vector, or a scalar) 4 | % containing a single non-zero entry, at position ORIGIN (defaults to 5 | % ceil(size/2)), of value AMPLITUDE (defaults to 1). 6 | 7 | % Eero Simoncelli, 6/96. 8 | 9 | function [res] = mkImpulse(sz, origin, amplitude) 10 | 11 | sz = sz(:)'; 12 | if (size(sz,2) == 1) 13 | sz = [sz sz]; 14 | end 15 | 16 | if (exist('origin') ~= 1) 17 | origin = ceil(sz/2); 18 | end 19 | 20 | if (exist('amplitude') ~= 1) 21 | amplitude = 1; 22 | end 23 | 24 | res = zeros(sz); 25 | res(origin(1),origin(2)) = amplitude; 26 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/mkR.m: -------------------------------------------------------------------------------- 1 | % IM = mkR(SIZE, EXPT, ORIGIN) 2 | % 3 | % Compute a matrix of dimension SIZE (a [Y X] 2-vector, or a scalar) 4 | % containing samples of a radial ramp function, raised to power EXPT 5 | % (default = 1), with given ORIGIN (default = (size+1)/2, [1 1] = 6 | % upper left). All but the first argument are optional. 7 | 8 | % Eero Simoncelli, 6/96. 9 | 10 | function [res] = mkR(sz, expt, origin) 11 | 12 | sz = sz(:); 13 | if (size(sz,1) == 1) 14 | sz = [sz,sz]; 15 | end 16 | 17 | % ----------------------------------------------------------------- 18 | % OPTIONAL args: 19 | 20 | if (exist('expt') ~= 1) 21 | expt = 1; 22 | end 23 | 24 | if (exist('origin') ~= 1) 25 | origin = (sz+1)/2; 26 | end 27 | 28 | % ----------------------------------------------------------------- 29 | 30 | [xramp,yramp] = meshgrid( [1:sz(2)]-origin(2), [1:sz(1)]-origin(1) ); 31 | 32 | res = (xramp.^2 + yramp.^2).^(expt/2); 33 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/mkRamp.m: -------------------------------------------------------------------------------- 1 | % IM = mkRamp(SIZE, DIRECTION, SLOPE, INTERCEPT, ORIGIN) 2 | % 3 | % Compute a matrix of dimension SIZE (a [Y X] 2-vector, or a scalar) 4 | % containing samples of a ramp function, with given gradient DIRECTION 5 | % (radians, CW from X-axis, default = 0), SLOPE (per pixel, default = 6 | % 1), and a value of INTERCEPT (default = 0) at the ORIGIN (default = 7 | % (size+1)/2, [1 1] = upper left). All but the first argument are 8 | % optional. 9 | 10 | % Eero Simoncelli, 6/96. 2/97: adjusted coordinate system. 11 | 12 | function [res] = mkRamp(sz, dir, slope, intercept, origin) 13 | 14 | sz = sz(:); 15 | if (size(sz,1) == 1) 16 | sz = [sz,sz]; 17 | end 18 | 19 | % ----------------------------------------------------------------- 20 | % OPTIONAL args: 21 | 22 | if (exist('dir') ~= 1) 23 | dir = 0; 24 | end 25 | 26 | if (exist('slope') ~= 1) 27 | slope = 1; 28 | end 29 | 30 | if (exist('intercept') ~= 1) 31 | intercept = 0; 32 | end 33 | 34 | if (exist('origin') ~= 1) 35 | origin = (sz+1)/2; 36 | end 37 | 38 | % ----------------------------------------------------------------- 39 | 40 | xinc = slope*cos(dir); 41 | yinc = slope*sin(dir); 42 | 43 | [xramp,yramp] = meshgrid( xinc*([1:sz(2)]-origin(2)), ... 44 | yinc*([1:sz(1)]-origin(1)) ); 45 | 46 | res = intercept + xramp + yramp; 47 | 48 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/mkSine.m: -------------------------------------------------------------------------------- 1 | % IM = mkSine(SIZE, PERIOD, DIRECTION, AMPLITUDE, PHASE, ORIGIN) 2 | % or 3 | % IM = mkSine(SIZE, FREQ, AMPLITUDE, PHASE, ORIGIN) 4 | % 5 | % Compute a matrix of dimension SIZE (a [Y X] 2-vector, or a scalar) 6 | % containing samples of a 2D sinusoid, with given PERIOD (in pixels), 7 | % DIRECTION (radians, CW from X-axis, default = 0), AMPLITUDE (default 8 | % = 1), and PHASE (radians, relative to ORIGIN, default = 0). ORIGIN 9 | % defaults to the center of the image. 10 | % 11 | % In the second form, FREQ is a 2-vector of frequencies (radians/pixel). 12 | 13 | % Eero Simoncelli, 6/96. 14 | 15 | function [res] = mkSine(sz, per_freq, dir_amp, amp_phase, phase_orig, orig) 16 | 17 | %------------------------------------------------------------ 18 | %% OPTIONAL ARGS: 19 | 20 | if (prod(size(per_freq)) == 2) 21 | frequency = norm(per_freq); 22 | direction = atan2(per_freq(1),per_freq(2)); 23 | if (exist('dir_amp') == 1) 24 | amplitude = dir_amp; 25 | else 26 | amplitude = 1; 27 | end 28 | if (exist('amp_phase') == 1) 29 | phase = amp_phase; 30 | else 31 | phase = 0; 32 | end 33 | if (exist('phase_orig') == 1) 34 | origin = phase_orig; 35 | end 36 | if (exist('orig') == 1) 37 | error('Too many arguments for (second form) of mkSine'); 38 | end 39 | else 40 | frequency = 2*pi/per_freq; 41 | if (exist('dir_amp') == 1) 42 | direction = dir_amp; 43 | else 44 | direction = 0; 45 | end 46 | if (exist('amp_phase') == 1) 47 | amplitude = amp_phase; 48 | else 49 | amplitude = 1; 50 | end 51 | if (exist('phase_orig') == 1) 52 | phase = phase_orig; 53 | else 54 | phase = 0; 55 | end 56 | if (exist('orig') == 1) 57 | origin = orig; 58 | end 59 | end 60 | 61 | %------------------------------------------------------------ 62 | 63 | if (exist('origin') == 1) 64 | res = amplitude*sin(mkRamp(sz, direction, frequency, phase, origin)); 65 | else 66 | res = amplitude*sin(mkRamp(sz, direction, frequency, phase)); 67 | end 68 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/mkSquare.m: -------------------------------------------------------------------------------- 1 | % IM = mkSquare(SIZE, PERIOD, DIRECTION, AMPLITUDE, PHASE, ORIGIN, TWIDTH) 2 | % or 3 | % IM = mkSine(SIZE, FREQ, AMPLITUDE, PHASE, ORIGIN, TWIDTH) 4 | % 5 | % Compute a matrix of dimension SIZE (a [Y X] 2-vector, or a scalar) 6 | % containing samples of a 2D square wave, with given PERIOD (in 7 | % pixels), DIRECTION (radians, CW from X-axis, default = 0), AMPLITUDE 8 | % (default = 1), and PHASE (radians, relative to ORIGIN, default = 0). 9 | % ORIGIN defaults to the center of the image. TWIDTH specifies width 10 | % of raised-cosine edges on the bars of the grating (default = 11 | % min(2,period/3)). 12 | % 13 | % In the second form, FREQ is a 2-vector of frequencies (radians/pixel). 14 | 15 | % Eero Simoncelli, 6/96. 16 | 17 | % TODO: Add duty cycle. 18 | 19 | function [res] = mkSquare(sz, per_freq, dir_amp, amp_phase, phase_orig, orig_twidth, twidth) 20 | 21 | %------------------------------------------------------------ 22 | %% OPTIONAL ARGS: 23 | 24 | if (prod(size(per_freq)) == 2) 25 | frequency = norm(per_freq); 26 | direction = atan2(per_freq(1),per_freq(2)); 27 | if (exist('dir_amp') == 1) 28 | amplitude = dir_amp; 29 | else 30 | amplitude = 1; 31 | end 32 | if (exist('amp_phase') == 1) 33 | phase = amp_phase; 34 | else 35 | phase = 0; 36 | end 37 | if (exist('phase_orig') == 1) 38 | origin = phase_orig; 39 | end 40 | if (exist('orig_twidth') == 1) 41 | transition = orig_twidth; 42 | else 43 | transition = min(2,2*pi/(3*frequency)); 44 | end 45 | if (exist('twidth') == 1) 46 | error('Too many arguments for (second form) of mkSine'); 47 | end 48 | else 49 | frequency = 2*pi/per_freq; 50 | if (exist('dir_amp') == 1) 51 | direction = dir_amp; 52 | else 53 | direction = 0; 54 | end 55 | if (exist('amp_phase') == 1) 56 | amplitude = amp_phase; 57 | else 58 | amplitude = 1; 59 | end 60 | if (exist('phase_orig') == 1) 61 | phase = phase_orig; 62 | else 63 | phase = 0; 64 | end 65 | if (exist('orig_twidth') == 1) 66 | origin = orig_twidth; 67 | end 68 | if (exist('twidth') == 1) 69 | transition = twidth; 70 | else 71 | transition = min(2,2*pi/(3*frequency)); 72 | end 73 | 74 | end 75 | 76 | %------------------------------------------------------------ 77 | 78 | if (exist('origin') == 1) 79 | res = mkRamp(sz, direction, frequency, phase, origin) - pi/2; 80 | else 81 | res = mkRamp(sz, direction, frequency, phase) - pi/2; 82 | end 83 | 84 | [Xtbl,Ytbl] = rcosFn(transition*frequency,pi/2,[-amplitude amplitude]); 85 | 86 | res = pointOp(abs(mod(res+pi, 2*pi)-pi),Ytbl,Xtbl(1),Xtbl(2)-Xtbl(1),0); 87 | 88 | % OLD threshold version: 89 | %res = amplitude * (mod(res,2*pi) < pi); 90 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/mkZonePlate.m: -------------------------------------------------------------------------------- 1 | % IM = mkZonePlate(SIZE, AMPL, PHASE) 2 | % 3 | % Make a "zone plate" image: 4 | % AMPL * cos( r^2 + PHASE) 5 | % SIZE specifies the matrix size, as for zeros(). 6 | % AMPL (default = 1) and PHASE (default = 0) are optional. 7 | 8 | % Eero Simoncelli, 6/96. 9 | 10 | function [res] = mkZonePlate(sz, ampl, ph) 11 | 12 | sz = sz(:); 13 | if (size(sz,1) == 1) 14 | sz = [sz,sz]; 15 | end 16 | 17 | mxsz = max(sz(1),sz(2)); 18 | 19 | %------------------------------------------------------------ 20 | %% OPTIONAL ARGS: 21 | 22 | if (exist('ampl') ~= 1) 23 | ampl = 1; 24 | end 25 | 26 | if (exist('ph') ~= 1) 27 | ph = 0; 28 | end 29 | 30 | %------------------------------------------------------------ 31 | 32 | res = ampl * cos( (pi/mxsz) * mkR(sz,2) + ph ); 33 | 34 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/modulateFlip.m: -------------------------------------------------------------------------------- 1 | % [HFILT] = modulateFlipShift(LFILT) 2 | % 3 | % QMF/Wavelet highpass filter construction: modulate by (-1)^n, 4 | % reverse order (and shift by one, which is handled by the convolution 5 | % routines). This is an extension of the original definition of QMF's 6 | % (e.g., see Simoncelli90). 7 | 8 | % Eero Simoncelli, 7/96. 9 | 10 | function [hfilt] = modulateFlipShift(lfilt) 11 | 12 | lfilt = lfilt(:); 13 | 14 | sz = size(lfilt,1); 15 | sz2 = ceil(sz/2); 16 | 17 | ind = [sz:-1:1]'; 18 | 19 | hfilt = lfilt(ind) .* (-1).^(ind-sz2); 20 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/nextFig.m: -------------------------------------------------------------------------------- 1 | % nextFig (MAXFIGS, SKIP) 2 | % 3 | % Make figure number mod((GCF+SKIP), MAXFIGS) the current figure. 4 | % MAXFIGS is optional, and defaults to 2. 5 | % SKIP is optional, and defaults to 1. 6 | 7 | % Eero Simoncelli, 2/97. 8 | 9 | function nextFig(maxfigs, skip) 10 | 11 | if (exist('maxfigs') ~= 1) 12 | maxfigs = 2; 13 | end 14 | 15 | if (exist('skip') ~= 1) 16 | skip = 1; 17 | end 18 | 19 | figure(1+mod(gcf-1+skip,maxfigs)); 20 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/pgmRead.m: -------------------------------------------------------------------------------- 1 | % IM = pgmRead( FILENAME ) 2 | % 3 | % Load a pgm image into a MatLab matrix. 4 | % This format is accessible from the XV image browsing utility. 5 | % Only works for 8bit gray images (raw or ascii) 6 | 7 | % Hany Farid, Spring '96. Modified by Eero Simoncelli, 6/96. 8 | 9 | function im = pgmRead( fname ); 10 | 11 | [fid,msg] = fopen( fname, 'r' ); 12 | 13 | if (fid == -1) 14 | error(msg); 15 | end 16 | 17 | %%% First line contains ID string: 18 | %%% "P1" = ascii bitmap, "P2" = ascii greymap, 19 | %%% "P3" = ascii pixmap, "P4" = raw bitmap, 20 | %%% "P5" = raw greymap, "P6" = raw pixmap 21 | TheLine = fgetl(fid); 22 | format = TheLine; 23 | 24 | if ~((format(1:2) == 'P2') | (format(1:2) == 'P5')) 25 | error('PGM file must be of type P2 or P5'); 26 | end 27 | 28 | %%% Any number of comment lines 29 | TheLine = fgetl(fid); 30 | while TheLine(1) == '#' 31 | TheLine = fgetl(fid); 32 | end 33 | 34 | %%% dimensions 35 | sz = sscanf(TheLine,'%d',2); 36 | xdim = sz(1); 37 | ydim = sz(2); 38 | sz = xdim * ydim; 39 | 40 | %%% Maximum pixel value 41 | TheLine = fgetl(fid); 42 | maxval = sscanf(TheLine, '%d',1); 43 | 44 | %%im = zeros(dim,1); 45 | if (format(2) == '2') 46 | [im,count] = fscanf(fid,'%d',sz); 47 | else 48 | [im,count] = fread(fid,sz,'uchar'); 49 | end 50 | 51 | fclose(fid); 52 | 53 | if (count == sz) 54 | im = reshape( im, xdim, ydim )'; 55 | else 56 | fprintf(1,'Warning: File ended early!'); 57 | im = reshape( [im ; zeros(sz-count,1)], xdim, ydim)'; 58 | end 59 | 60 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/pixelAxes.m: -------------------------------------------------------------------------------- 1 | % [ZOOM] = pixelAxes(DIMS, ZOOM) 2 | % 3 | % Set the axes of the current plot to cover a multiple of DIMS pixels, 4 | % thereby eliminating screen aliasing artifacts when displaying an 5 | % image of size DIMS. 6 | % 7 | % ZOOM (optional, default='same') expresses the desired number of 8 | % samples displayed per screen pixel. It should be a scalar, which 9 | % will be rounded to the nearest integer, or 1 over an integer. It 10 | % may also be the string 'same' or 'auto', in which case the value is chosen so 11 | % as to produce an image closest in size to the currently displayed 12 | % image. It may also be the string 'full', in which case the image is 13 | % made as large as possible while still fitting in the window. 14 | 15 | % Eero Simoncelli, 2/97. 16 | 17 | function [zoom] = pixelAxes(dims, zoom) 18 | 19 | %------------------------------------------------------------ 20 | %% OPTIONAL ARGS: 21 | 22 | if (exist('zoom') ~= 1) 23 | zoom = 'same'; 24 | end 25 | 26 | %% Reverse dimension order, since Figure Positions reported as (x,y). 27 | dims = dims(2:-1:1); 28 | 29 | %% Use MatLab's axis function to force square pixels, etc: 30 | axis('image'); 31 | ax = gca; 32 | 33 | oldunits = get(ax,'Units'); 34 | 35 | if strcmp(zoom,'full'); 36 | set(ax,'Units','normalized'); 37 | set(ax,'Position',[0 0 1 1]); 38 | zoom = 'same'; 39 | end 40 | 41 | set(ax,'Units','pixels'); 42 | pos = get(ax,'Position'); 43 | ctr = pos(1:2)+pos(3:4)/2; 44 | 45 | if (strcmp(zoom,'same') | strcmp(zoom,'auto')) 46 | %% HACK: enlarge slightly so that floor doesn't round down 47 | zoom = min( pos(3:4) ./ (dims - 1) ); 48 | elseif isstr(zoom) 49 | error(sprintf('Bad ZOOM argument: %s',zoom)); 50 | end 51 | 52 | %% Force zoom value to be an integer, or inverse integer. 53 | if (zoom < 0.75) 54 | zoom = 1/ceil(1/zoom); 55 | %% Round upward, subtracting 0.5 to avoid floating point errors. 56 | newsz = ceil(zoom*(dims-0.5)); 57 | else 58 | zoom = floor(zoom + 0.001); % Avoid floating pt errors 59 | if (zoom < 1.5) % zoom=1 60 | zoom = 1; 61 | newsz = dims + 0.5; 62 | else 63 | newsz = zoom*(dims-1) + mod(zoom,2); 64 | end 65 | end 66 | 67 | set(ax,'Position', [floor(ctr-newsz/2)+0.5, newsz] ) 68 | 69 | % Restore units 70 | set(ax,'Units',oldunits); 71 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/pointOp.m: -------------------------------------------------------------------------------- 1 | % RES = pointOp(IM, LUT, ORIGIN, INCREMENT, WARNINGS) 2 | % 3 | % Apply a point operation, specified by lookup table LUT, to image IM. 4 | % LUT must be a row or column vector, and is assumed to contain 5 | % (equi-spaced) samples of the function. ORIGIN specifies the 6 | % abscissa associated with the first sample, and INCREMENT specifies the 7 | % spacing between samples. Between-sample values are estimated via 8 | % linear interpolation. If WARNINGS is non-zero, the function prints 9 | % a warning whenever the lookup table is extrapolated. 10 | % 11 | % This function is much faster than MatLab's interp1, and allows 12 | % extrapolation beyond the lookup table domain. The drawbacks are 13 | % that the lookup table must be equi-spaced, and the interpolation is 14 | % linear. 15 | 16 | % Eero Simoncelli, 8/96. 17 | 18 | function res = pointOp(im, lut, origin, increment, warnings) 19 | 20 | %% NOTE: THIS CODE IS NOT ACTUALLY USED! (MEX FILE IS CALLED INSTEAD) 21 | 22 | fprintf(1,'WARNING: You should compile the MEX version of "pointOp.c",\n found in the MEX subdirectory of matlabPyrTools, and put it in your matlab path. It is MUCH faster.\n'); 23 | 24 | X = origin + increment*[0:size(lut(:),1)-1]; 25 | Y = lut(:); 26 | 27 | res = reshape(interp1(X, Y, im(:), 'linear', 'extrap'),size(im)); 28 | 29 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/pointOp.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/pointOp.mexa64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/pointOp.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/pointOp.mexglx -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/pointOp.mexmac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/pointOp.mexmac -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/pointOp.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/pointOp.mexmaci64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/pointOp.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/pointOp.mexw32 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/pwd2path.m: -------------------------------------------------------------------------------- 1 | % PWD2PATH() 2 | % 3 | % add current working directory (pwd) to path. 4 | 5 | P = path; 6 | path(pwd,P); 7 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/pyrBand.m: -------------------------------------------------------------------------------- 1 | % RES = pyrBand(PYR, INDICES, BAND_NUM) 2 | % 3 | % Access a subband from a pyramid (gaussian, laplacian, QMF/wavelet, 4 | % or steerable). Subbands are numbered consecutively, from finest 5 | % (highest spatial frequency) to coarsest (lowest spatial frequency). 6 | 7 | % Eero Simoncelli, 6/96. 8 | 9 | function res = pyrBand(pyr, pind, band) 10 | 11 | res = reshape( pyr(pyrBandIndices(pind,band)), pind(band,1), pind(band,2) ); 12 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/pyrBandIndices.m: -------------------------------------------------------------------------------- 1 | % RES = pyrBandIndices(INDICES, BAND_NUM) 2 | % 3 | % Return indices for accessing a subband from a pyramid 4 | % (gaussian, laplacian, QMF/wavelet, steerable). 5 | 6 | % Eero Simoncelli, 6/96. 7 | 8 | function indices = pyrBandIndices(pind,band) 9 | 10 | if ((band > size(pind,1)) | (band < 1)) 11 | error(sprintf('BAND_NUM must be between 1 and number of pyramid bands (%d).', ... 12 | size(pind,1))); 13 | end 14 | 15 | if (size(pind,2) ~= 2) 16 | error('INDICES must be an Nx2 matrix indicating the size of the pyramid subbands'); 17 | end 18 | 19 | ind = 1; 20 | for l=1:band-1 21 | ind = ind + prod(pind(l,:)); 22 | end 23 | 24 | indices = ind:ind+prod(pind(band,:))-1; 25 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/pyrLow.m: -------------------------------------------------------------------------------- 1 | % RES = pyrLow(PYR, INDICES) 2 | % 3 | % Access the lowpass subband from a pyramid 4 | % (gaussian, laplacian, QMF/wavelet, steerable). 5 | 6 | % Eero Simoncelli, 6/96. 7 | 8 | function res = pyrLow(pyr,pind) 9 | 10 | band = size(pind,1); 11 | 12 | res = reshape( pyr(pyrBandIndices(pind,band)), pind(band,1), pind(band,2) ); 13 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/pyrTools.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/pyrTools.pdf -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/range2.m: -------------------------------------------------------------------------------- 1 | % [MIN, MAX] = range2(MTX) 2 | % 3 | % Compute minimum and maximum values of MTX, returning them as a 2-vector. 4 | 5 | % Eero Simoncelli, 3/97. 6 | 7 | function [mn, mx] = range2(mtx) 8 | 9 | %% NOTE: THIS CODE IS NOT ACTUALLY USED! (MEX FILE IS CALLED INSTEAD) 10 | 11 | fprintf(1,'WARNING: You should compile the MEX version of "range2.c",\n found in the MEX subdirectory of matlabPyrTools, and put it in your matlab path. It is MUCH faster.\n'); 12 | 13 | if (~isreal(mtx)) 14 | error('MTX must be real-valued'); 15 | end 16 | 17 | mn = min(min(mtx)); 18 | mx = max(max(mtx)); 19 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/range2.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/range2.mexa64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/range2.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/range2.mexglx -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/range2.mexmac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/range2.mexmac -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/range2.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/range2.mexmaci64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/range2.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/range2.mexw32 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/rconv2.m: -------------------------------------------------------------------------------- 1 | % RES = RCONV2(MTX1, MTX2, CTR) 2 | % 3 | % Convolution of two matrices, with boundaries handled via reflection 4 | % about the edge pixels. Result will be of size of LARGER matrix. 5 | % 6 | % The origin of the smaller matrix is assumed to be its center. 7 | % For even dimensions, the origin is determined by the CTR (optional) 8 | % argument: 9 | % CTR origin 10 | % 0 DIM/2 (default) 11 | % 1 (DIM/2)+1 12 | 13 | % Eero Simoncelli, 6/96. 14 | 15 | function c = rconv2(a,b,ctr) 16 | 17 | if (exist('ctr') ~= 1) 18 | ctr = 0; 19 | end 20 | 21 | if (( size(a,1) >= size(b,1) ) & ( size(a,2) >= size(b,2) )) 22 | large = a; small = b; 23 | elseif (( size(a,1) <= size(b,1) ) & ( size(a,2) <= size(b,2) )) 24 | large = b; small = a; 25 | else 26 | error('one arg must be larger than the other in both dimensions!'); 27 | end 28 | 29 | ly = size(large,1); 30 | lx = size(large,2); 31 | sy = size(small,1); 32 | sx = size(small,2); 33 | 34 | %% These values are one less than the index of the small mtx that falls on 35 | %% the border pixel of the large matrix when computing the first 36 | %% convolution response sample: 37 | sy2 = floor((sy+ctr-1)/2); 38 | sx2 = floor((sx+ctr-1)/2); 39 | 40 | % pad with reflected copies 41 | clarge = [ 42 | large(sy-sy2:-1:2,sx-sx2:-1:2), large(sy-sy2:-1:2,:), ... 43 | large(sy-sy2:-1:2,lx-1:-1:lx-sx2); ... 44 | large(:,sx-sx2:-1:2), large, large(:,lx-1:-1:lx-sx2); ... 45 | large(ly-1:-1:ly-sy2,sx-sx2:-1:2), ... 46 | large(ly-1:-1:ly-sy2,:), ... 47 | large(ly-1:-1:ly-sy2,lx-1:-1:lx-sx2) ]; 48 | 49 | c = conv2(clarge,small,'valid'); 50 | 51 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/rcosFn.m: -------------------------------------------------------------------------------- 1 | % [X, Y] = rcosFn(WIDTH, POSITION, VALUES) 2 | % 3 | % Return a lookup table (suitable for use by INTERP1) 4 | % containing a "raised cosine" soft threshold function: 5 | % 6 | % Y = VALUES(1) + (VALUES(2)-VALUES(1)) * 7 | % cos^2( PI/2 * (X - POSITION + WIDTH)/WIDTH ) 8 | % 9 | % WIDTH is the width of the region over which the transition occurs 10 | % (default = 1). POSITION is the location of the center of the 11 | % threshold (default = 0). VALUES (default = [0,1]) specifies the 12 | % values to the left and right of the transition. 13 | 14 | % Eero Simoncelli, 7/96. 15 | 16 | function [X, Y] = rcosFn(width,position,values) 17 | 18 | %------------------------------------------------------------ 19 | % OPTIONAL ARGS: 20 | 21 | if (exist('width') ~= 1) 22 | width = 1; 23 | end 24 | 25 | if (exist('position') ~= 1) 26 | position = 0; 27 | end 28 | 29 | if (exist('values') ~= 1) 30 | values = [0,1]; 31 | end 32 | 33 | %------------------------------------------------------------ 34 | 35 | sz = 256; %% arbitrary! 36 | 37 | X = pi * [-sz-1:1] / (2*sz); 38 | 39 | Y = values(1) + (values(2)-values(1)) * cos(X).^2; 40 | 41 | % Make sure end values are repeated, for extrapolation... 42 | Y(1) = Y(2); 43 | Y(sz+3) = Y(sz+2); 44 | 45 | X = position + (2*width/pi) * (X + pi/4); 46 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/reconLpyr.m: -------------------------------------------------------------------------------- 1 | % RES = reconLpyr(PYR, INDICES, LEVS, FILT2, EDGES) 2 | % 3 | % Reconstruct image from Laplacian pyramid, as created by buildLpyr. 4 | % 5 | % PYR is a vector containing the N pyramid subbands, ordered from fine 6 | % to coarse. INDICES is an Nx2 matrix containing the sizes of 7 | % each subband. This is compatible with the MatLab Wavelet toolbox. 8 | % 9 | % LEVS (optional) should be a list of levels to include, or the string 10 | % 'all' (default). The finest scale is number 1. The lowpass band 11 | % corresponds to lpyrHt(INDICES)+1. 12 | % 13 | % FILT2 (optional) can be a string naming a standard filter (see 14 | % namedFilter), or a vector which will be used for (separable) 15 | % convolution. Default = 'binom5'. EDGES specifies edge-handling, 16 | % and defaults to 'reflect1' (see corrDn). 17 | 18 | % Eero Simoncelli, 6/96 19 | 20 | function res = reconLpyr(pyr, ind, levs, filt2, edges) 21 | 22 | if (nargin < 2) 23 | error('First two arguments (PYR, INDICES) are required'); 24 | end 25 | 26 | %%------------------------------------------------------------ 27 | %% DEFAULTS: 28 | 29 | if (exist('levs') ~= 1) 30 | levs = 'all'; 31 | end 32 | 33 | if (exist('filt2') ~= 1) 34 | filt2 = 'binom5'; 35 | end 36 | 37 | if (exist('edges') ~= 1) 38 | edges= 'reflect1'; 39 | end 40 | %%------------------------------------------------------------ 41 | 42 | maxLev = 1+lpyrHt(ind); 43 | if strcmp(levs,'all') 44 | levs = [1:maxLev]'; 45 | else 46 | if (any(levs > maxLev)) 47 | error(sprintf('Level numbers must be in the range [1, %d].', maxLev)); 48 | end 49 | levs = levs(:); 50 | end 51 | 52 | if isstr(filt2) 53 | filt2 = namedFilter(filt2); 54 | end 55 | 56 | filt2 = filt2(:); 57 | res_sz = ind(1,:); 58 | 59 | if any(levs > 1) 60 | 61 | int_sz = [ind(1,1), ind(2,2)]; 62 | 63 | nres = reconLpyr( pyr(prod(res_sz)+1:size(pyr,1)), ... 64 | ind(2:size(ind,1),:), levs-1, filt2, edges); 65 | 66 | if (res_sz(1) == 1) 67 | res = upConv(nres, filt2', edges, [1 2], [1 1], res_sz); 68 | elseif (res_sz(2) == 1) 69 | res = upConv(nres, filt2, edges, [2 1], [1 1], res_sz); 70 | else 71 | hi = upConv(nres, filt2, edges, [2 1], [1 1], int_sz); 72 | res = upConv(hi, filt2', edges, [1 2], [1 1], res_sz); 73 | end 74 | 75 | else 76 | 77 | res = zeros(res_sz); 78 | 79 | end 80 | 81 | if any(levs == 1) 82 | res = res + pyrBand(pyr,ind,1); 83 | end 84 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/reconSFpyrLevs.m: -------------------------------------------------------------------------------- 1 | % RESDFT = reconSFpyrLevs(PYR,INDICES,LOGRAD,XRCOS,YRCOS,ANGLE,NBANDS,LEVS,BANDS) 2 | % 3 | % Recursive function for reconstructing levels of a steerable pyramid 4 | % representation. This is called by reconSFpyr, and is not usually 5 | % called directly. 6 | 7 | % Eero Simoncelli, 5/97. 8 | 9 | function resdft = reconSFpyrLevs(pyr,pind,log_rad,Xrcos,Yrcos,angle,nbands,levs,bands); 10 | 11 | lo_ind = nbands+1; 12 | dims = pind(1,:); 13 | ctr = ceil((dims+0.5)/2); 14 | 15 | % log_rad = log_rad + 1; 16 | Xrcos = Xrcos - log2(2); % shift origin of lut by 1 octave. 17 | 18 | if any(levs > 1) 19 | 20 | lodims = ceil((dims-0.5)/2); 21 | loctr = ceil((lodims+0.5)/2); 22 | lostart = ctr-loctr+1; 23 | loend = lostart+lodims-1; 24 | nlog_rad = log_rad(lostart(1):loend(1),lostart(2):loend(2)); 25 | nangle = angle(lostart(1):loend(1),lostart(2):loend(2)); 26 | 27 | if (size(pind,1) > lo_ind) 28 | nresdft = reconSFpyrLevs( pyr(1+sum(prod(pind(1:lo_ind-1,:)')):size(pyr,1)),... 29 | pind(lo_ind:size(pind,1),:), ... 30 | nlog_rad, Xrcos, Yrcos, nangle, nbands,levs-1, bands); 31 | else 32 | nresdft = fftshift(fft2(pyrBand(pyr,pind,lo_ind))); 33 | end 34 | 35 | YIrcos = sqrt(abs(1.0 - Yrcos.^2)); 36 | lomask = pointOp(nlog_rad, YIrcos, Xrcos(1), Xrcos(2)-Xrcos(1), 0); 37 | 38 | resdft = zeros(dims); 39 | resdft(lostart(1):loend(1),lostart(2):loend(2)) = nresdft .* lomask; 40 | 41 | else 42 | 43 | resdft = zeros(dims); 44 | 45 | end 46 | 47 | 48 | if any(levs == 1) 49 | 50 | lutsize = 1024; 51 | Xcosn = pi*[-(2*lutsize+1):(lutsize+1)]/lutsize; % [-2*pi:pi] 52 | order = nbands-1; 53 | %% divide by sqrt(sum_(n=0)^(N-1) cos(pi*n/N)^(2(N-1)) ) 54 | const = (2^(2*order))*(factorial(order)^2)/(nbands*factorial(2*order)); 55 | Ycosn = sqrt(const) * (cos(Xcosn)).^order; 56 | himask = pointOp(log_rad, Yrcos, Xrcos(1), Xrcos(2)-Xrcos(1),0); 57 | 58 | ind = 1; 59 | for b = 1:nbands 60 | if any(bands == b) 61 | anglemask = pointOp(angle,Ycosn,Xcosn(1)+pi*(b-1)/nbands,Xcosn(2)-Xcosn(1)); 62 | band = reshape(pyr(ind:ind+prod(dims)-1), dims(1), dims(2)); 63 | banddft = fftshift(fft2(band)); 64 | resdft = resdft + (sqrt(-1))^(nbands-1) * banddft.*anglemask.*himask; 65 | end 66 | ind = ind + prod(dims); 67 | end 68 | end 69 | 70 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/reconSpyr.m: -------------------------------------------------------------------------------- 1 | % RES = reconSpyr(PYR, INDICES, FILTFILE, EDGES, LEVS, BANDS) 2 | % 3 | % Reconstruct image from its steerable pyramid representation, as created 4 | % by buildSpyr. 5 | % 6 | % PYR is a vector containing the N pyramid subbands, ordered from fine 7 | % to coarse. INDICES is an Nx2 matrix containing the sizes of 8 | % each subband. This is compatible with the MatLab Wavelet toolbox. 9 | % 10 | % FILTFILE (optional) should be a string referring to an m-file that returns 11 | % the rfilters. examples: sp0Filters, sp1Filters, sp3Filters 12 | % (default = 'sp1Filters'). 13 | % EDGES specifies edge-handling, and defaults to 'reflect1' (see 14 | % corrDn). 15 | % 16 | % LEVS (optional) should be a list of levels to include, or the string 17 | % 'all' (default). 0 corresonds to the residual highpass subband. 18 | % 1 corresponds to the finest oriented scale. The lowpass band 19 | % corresponds to number spyrHt(INDICES)+1. 20 | % 21 | % BANDS (optional) should be a list of bands to include, or the string 22 | % 'all' (default). 1 = vertical, rest proceeding anti-clockwise. 23 | 24 | % Eero Simoncelli, 6/96. 25 | 26 | function res = reconSpyr(pyr, pind, filtfile, edges, levs, bands) 27 | 28 | %%------------------------------------------------------------ 29 | %% DEFAULTS: 30 | 31 | if (exist('filtfile') ~= 1) 32 | filtfile = 'sp1Filters'; 33 | end 34 | 35 | if (exist('edges') ~= 1) 36 | edges= 'reflect1'; 37 | end 38 | 39 | if (exist('levs') ~= 1) 40 | levs = 'all'; 41 | end 42 | 43 | if (exist('bands') ~= 1) 44 | bands = 'all'; 45 | end 46 | 47 | %%------------------------------------------------------------ 48 | 49 | if (isstr(filtfile) & (exist(filtfile) == 2)) 50 | [lo0filt,hi0filt,lofilt,bfilts,steermtx,harmonics] = eval(filtfile); 51 | nbands = spyrNumBands(pind); 52 | if ((nbands > 0) & (size(bfilts,2) ~= nbands)) 53 | error('Number of pyramid bands is inconsistent with filter file'); 54 | end 55 | else 56 | error('filtfile argument must be the name of an M-file containing SPYR filters.'); 57 | end 58 | 59 | maxLev = 1+spyrHt(pind); 60 | if strcmp(levs,'all') 61 | levs = [0:maxLev]'; 62 | else 63 | if (any(levs > maxLev) | any(levs < 0)) 64 | error(sprintf('Level numbers must be in the range [0, %d].', maxLev)); 65 | end 66 | levs = levs(:); 67 | end 68 | 69 | if strcmp(bands,'all') 70 | bands = [1:nbands]'; 71 | else 72 | if (any(bands < 1) | any(bands > nbands)) 73 | error(sprintf('Band numbers must be in the range [1,3].', nbands)); 74 | end 75 | bands = bands(:); 76 | end 77 | 78 | if (spyrHt(pind) == 0) 79 | if (any(levs==1)) 80 | res1 = pyrBand(pyr,pind,2); 81 | else 82 | res1 = zeros(pind(2,:)); 83 | end 84 | else 85 | res1 = reconSpyrLevs(pyr(1+prod(pind(1,:)):size(pyr,1)), ... 86 | pind(2:size(pind,1),:), ... 87 | lofilt, bfilts, edges, levs, bands); 88 | end 89 | 90 | res = upConv(res1, lo0filt, edges); 91 | 92 | %% residual highpass subband 93 | if any(levs == 0) 94 | res = upConv( subMtx(pyr, pind(1,:)), hi0filt, edges, [1 1], [1 1], size(res), res); 95 | end 96 | 97 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/reconSpyrLevs.m: -------------------------------------------------------------------------------- 1 | % RES = reconSpyrLevs(PYR,INDICES,LOFILT,BFILTS,EDGES,LEVS,BANDS) 2 | % 3 | % Recursive function for reconstructing levels of a steerable pyramid 4 | % representation. This is called by reconSpyr, and is not usually 5 | % called directly. 6 | 7 | % Eero Simoncelli, 6/96. 8 | 9 | function res = reconSpyrLevs(pyr,pind,lofilt,bfilts,edges,levs,bands); 10 | 11 | nbands = size(bfilts,2); 12 | lo_ind = nbands+1; 13 | res_sz = pind(1,:); 14 | 15 | % Assume square filters: 16 | bfiltsz = round(sqrt(size(bfilts,1))); 17 | 18 | if any(levs > 1) 19 | 20 | if (size(pind,1) > lo_ind) 21 | nres = reconSpyrLevs( pyr(1+sum(prod(pind(1:lo_ind-1,:)')):size(pyr,1)), ... 22 | pind(lo_ind:size(pind,1),:), ... 23 | lofilt, bfilts, edges, levs-1, bands); 24 | else 25 | nres = pyrBand(pyr,pind,lo_ind); % lowpass subband 26 | end 27 | 28 | res = upConv(nres, lofilt, edges, [2 2], [1 1], res_sz); 29 | 30 | else 31 | 32 | res = zeros(res_sz); 33 | 34 | end 35 | 36 | if any(levs == 1) 37 | ind = 1; 38 | for b = 1:nbands 39 | if any(bands == b) 40 | bfilt = reshape(bfilts(:,b), bfiltsz, bfiltsz); 41 | res = upConv(reshape(pyr(ind:ind+prod(res_sz)-1), res_sz(1), res_sz(2)), ... 42 | bfilt, edges, [1 1], [1 1], res_sz, res); 43 | end 44 | ind = ind + prod(res_sz); 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/refparams_vecgsm.m: -------------------------------------------------------------------------------- 1 | function [ssarr, l_arr, cu_arr]=refparams_vecgsm(org,subands,M) 2 | 3 | %This function computes the parameters of the reference image. This is 4 | %called by vifvec.m. 5 | 6 | for i=1:length(subands); 7 | sub=subands(i); 8 | y=org{sub}; 9 | 10 | sizey=floor(size(y)./M)*M; % crop to exact multiple size 11 | y=y(1:sizey(1),1:sizey(2)); 12 | 13 | 14 | % Collect MxM blocks. Rearrange each block into an 15 | % M^2 dimensional vector and collect all such vectors. 16 | % Collece ALL possible MXM blocks (even those overlapping) from the subband 17 | temp=[]; 18 | for j=1:M 19 | for k=1:M 20 | temp=cat(1,temp,reshape(y(k:end-(M-k), j:end-(M-j)),1,[])); 21 | end 22 | end 23 | 24 | % estimate mean and covariance 25 | mcu=mean(temp')'; 26 | cu=((temp-repmat(mcu,1,size(temp,2)))*(temp-repmat(mcu,1,size(temp,2)))')./size(temp,2); % covariance matrix for U 27 | 28 | % Collect MxM blocks as above. Use ONLY non-overlapping blocks to 29 | % calculate the S field 30 | temp=[]; 31 | for j=1:M 32 | for k=1:M 33 | temp=cat(1,temp,reshape(y(k:M:end, j:M:end),1,[])); 34 | end 35 | end 36 | 37 | % Calculate the S field 38 | ss=(inv(cu)*temp); 39 | ss=sum(ss.*temp)./(M*M); 40 | ss=reshape(ss,sizey/M); 41 | 42 | % Eigen-decomposition 43 | [v,d]=eig(cu); 44 | l_arr(sub,:)=diag(d)'; 45 | 46 | % rearrange for output 47 | ssarr{sub}=ss; 48 | temp=0; 49 | d=diag(d); 50 | cu_arr{sub}=cu; 51 | end 52 | 53 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/setPyrBand.m: -------------------------------------------------------------------------------- 1 | % NEWPYR = setPyrBand(PYR, INDICES, NEWBAND, BAND_NUM) 2 | % 3 | % Insert an image (BAND) into a pyramid (gaussian, laplacian, QMF/wavelet, 4 | % or steerable). Subbands are numbered consecutively, from finest 5 | % (highest spatial frequency) to coarsest (lowest spatial frequency). 6 | 7 | % Eero Simoncelli, 1/03. 8 | 9 | function pyr = setPyrBand(pyr, pind, band, bandNum) 10 | 11 | %% Check: PIND a valid index matrix? 12 | if ( ~(ndims(pind) == 2) | ~(size(pind,2) == 2) | ~all(pind==round(pind)) ) 13 | pind 14 | error('pyrTools:badArg',... 15 | 'PIND argument is not an Nbands X 2 matrix of integers'); 16 | end 17 | 18 | %% Check: PIND consistent with size of PYR? 19 | if ( length(pyr) ~= sum(prod(pind,2)) ) 20 | error('pyrTools:badPyr',... 21 | 'Pyramid data vector length is inconsistent with index matrix PIND'); 22 | end 23 | 24 | %% Check: size of BAND consistent with desired BANDNUM? 25 | if (~all(size(band) == pind(bandNum,:))) 26 | size(band) 27 | pind(bandNum,:) 28 | error('pyrTools:badArg',... 29 | 'size of BAND to be inserted is inconsistent with BAND_NUM'); 30 | end 31 | 32 | pyr(pyrBandIndices(pind,bandNum)) = vectify(band); 33 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/shift.m: -------------------------------------------------------------------------------- 1 | % [RES] = shift(MTX, OFFSET) 2 | % 3 | % Circular shift 2D matrix samples by OFFSET (a [Y,X] 2-vector), 4 | % such that RES(POS) = MTX(POS-OFFSET). 5 | 6 | function res = shift(mtx, offset) 7 | 8 | dims = size(mtx); 9 | 10 | offset = mod(-offset,dims); 11 | 12 | res = [ mtx(offset(1)+1:dims(1), offset(2)+1:dims(2)), ... 13 | mtx(offset(1)+1:dims(1), 1:offset(2)); ... 14 | mtx(1:offset(1), offset(2)+1:dims(2)), ... 15 | mtx(1:offset(1), 1:offset(2)) ]; 16 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/skew2.m: -------------------------------------------------------------------------------- 1 | % S = SKEW2(MTX,MEAN,VAR) 2 | % 3 | % Sample skew (third moment divided by variance^3/2) of a matrix. 4 | % MEAN (optional) and VAR (optional) make the computation faster. 5 | 6 | function res = skew2(mtx, mn, v) 7 | 8 | if (exist('mn') ~= 1) 9 | mn = mean2(mtx); 10 | end 11 | 12 | if (exist('v') ~= 1) 13 | v = var2(mtx,mn); 14 | end 15 | 16 | if (isreal(mtx)) 17 | res = mean(mean((mtx-mn).^3)) / (v^(3/2)); 18 | else 19 | res = mean(mean(real(mtx-mn).^3)) / (real(v)^(3/2)) + ... 20 | i * mean(mean(imag(mtx-mn).^3)) / (imag(v)^(3/2)); 21 | end 22 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/spyrBand.m: -------------------------------------------------------------------------------- 1 | % [LEV,IND] = spyrBand(PYR,INDICES,LEVEL,BAND) 2 | % 3 | % Access a band from a steerable pyramid. 4 | % 5 | % LEVEL indicates the scale (finest = 1, coarsest = spyrHt(INDICES)). 6 | % 7 | % BAND (optional, default=1) indicates which subband 8 | % (1 = vertical, rest proceeding anti-clockwise). 9 | 10 | % Eero Simoncelli, 6/96. 11 | 12 | function res = spyrBand(pyr,pind,level,band) 13 | 14 | if (exist('level') ~= 1) 15 | level = 1; 16 | end 17 | 18 | if (exist('band') ~= 1) 19 | band = 1; 20 | end 21 | 22 | nbands = spyrNumBands(pind); 23 | if ((band > nbands) | (band < 1)) 24 | error(sprintf('Bad band number (%d) should be in range [1,%d].', band, nbands)); 25 | end 26 | 27 | maxLev = spyrHt(pind); 28 | if ((level > maxLev) | (level < 1)) 29 | error(sprintf('Bad level number (%d), should be in range [1,%d].', level, maxLev)); 30 | end 31 | 32 | firstband = 1 + band + nbands*(level-1); 33 | res = pyrBand(pyr, pind, firstband); 34 | 35 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/spyrHigh.m: -------------------------------------------------------------------------------- 1 | % RES = spyrHigh(PYR, INDICES) 2 | % 3 | % Access the highpass residual band from a steerable pyramid. 4 | 5 | % Eero Simoncelli, 6/96. 6 | 7 | function res = spyrHigh(pyr,pind) 8 | 9 | res = pyrBand(pyr, pind, 1); 10 | 11 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/spyrHt.m: -------------------------------------------------------------------------------- 1 | % [HEIGHT] = spyrHt(INDICES) 2 | % 3 | % Compute height of steerable pyramid with given index matrix. 4 | 5 | % Eero Simoncelli, 6/96. 6 | 7 | function [ht] = spyrHt(pind) 8 | 9 | nbands = spyrNumBands(pind); 10 | 11 | % Don't count lowpass, or highpass residual bands 12 | if (size(pind,1) > 2) 13 | ht = (size(pind,1)-2)/nbands; 14 | else 15 | ht = 0; 16 | end 17 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/spyrLev.m: -------------------------------------------------------------------------------- 1 | % [LEV,IND] = spyrLev(PYR,INDICES,LEVEL) 2 | % 3 | % Access a level from a steerable pyramid. 4 | % Return as an SxB matrix, B = number of bands, S = total size of a band. 5 | % Also returns an Bx2 matrix containing dimensions of the subbands. 6 | 7 | % Eero Simoncelli, 6/96. 8 | 9 | function [lev,ind] = spyrLev(pyr,pind,level) 10 | 11 | nbands = spyrNumBands(pind); 12 | 13 | if ((level > spyrHt(pind)) | (level < 1)) 14 | error(sprintf('Level number must be in the range [1, %d].', spyrHt(pind))); 15 | end 16 | 17 | firstband = 2 + nbands*(level-1); 18 | firstind = 1; 19 | for l=1:firstband-1 20 | firstind = firstind + prod(pind(l,:)); 21 | end 22 | 23 | ind = pind(firstband:firstband+nbands-1,:); 24 | lev = pyr(firstind:firstind+sum(prod(ind'))-1); 25 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/spyrNumBands.m: -------------------------------------------------------------------------------- 1 | % [NBANDS] = spyrNumBands(INDICES) 2 | % 3 | % Compute number of orientation bands in a steerable pyramid with 4 | % given index matrix. If the pyramid contains only the highpass and 5 | % lowpass bands (i.e., zero levels), returns 0. 6 | 7 | % Eero Simoncelli, 2/97. 8 | 9 | function [nbands] = spyrNumBands(pind) 10 | 11 | if (size(pind,1) == 2) 12 | nbands = 0; 13 | else 14 | % Count number of orientation bands: 15 | b = 3; 16 | while ((b <= size(pind,1)) & all( pind(b,:) == pind(2,:)) ) 17 | b = b+1; 18 | end 19 | nbands = b-2; 20 | end 21 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/steer.m: -------------------------------------------------------------------------------- 1 | % RES = STEER(BASIS, ANGLE, HARMONICS, STEERMTX) 2 | % 3 | % Steer BASIS to the specfied ANGLE. 4 | % 5 | % BASIS should be a matrix whose columns are vectorized rotated copies of a 6 | % steerable function, or the responses of a set of steerable filters. 7 | % 8 | % ANGLE can be a scalar, or a column vector the size of the basis. 9 | % 10 | % HARMONICS (optional, default is N even or odd low frequencies, as for 11 | % derivative filters) should be a list of harmonic numbers indicating 12 | % the angular harmonic content of the basis. 13 | % 14 | % STEERMTX (optional, default assumes cosine phase harmonic components, 15 | % and filter positions at 2pi*n/N) should be a matrix which maps 16 | % the filters onto Fourier series components (ordered [cos0 cos1 sin1 17 | % cos2 sin2 ... sinN]). See steer2HarmMtx.m 18 | 19 | % Eero Simoncelli, 7/96. 20 | 21 | function res = steer(basis,angle,harmonics,steermtx) 22 | 23 | num = size(basis,2); 24 | 25 | if ( any(size(angle) ~= [size(basis,1) 1]) & any(size(angle) ~= [1 1]) ) 26 | error('ANGLE must be a scalar, or a column vector the size of the basis elements'); 27 | end 28 | 29 | %% If HARMONICS are not passed, assume derivatives. 30 | if (exist('harmonics') ~= 1) 31 | if (mod(num,2) == 0) 32 | harmonics = [0:(num/2)-1]'*2 + 1; 33 | else 34 | harmonics = [0:(num-1)/2]'*2; 35 | end 36 | else 37 | harmonics = harmonics(:); 38 | if ((2*size(harmonics,1)-any(harmonics == 0)) ~= num) 39 | error('harmonics list is incompatible with basis size'); 40 | end 41 | end 42 | 43 | %% If STEERMTX not passed, assume evenly distributed cosine-phase filters: 44 | if (exist('steermtx') ~= 1) 45 | steermtx = steer2HarmMtx(harmonics, pi*[0:num-1]/num, 'even'); 46 | end 47 | 48 | steervect = zeros(size(angle,1),num); 49 | arg = angle * harmonics(find(harmonics~=0))'; 50 | if (all(harmonics)) 51 | steervect(:, 1:2:num) = cos(arg); 52 | steervect(:, 2:2:num) = sin(arg); 53 | else 54 | steervect(:, 1) = ones(size(arg,1),1); 55 | steervect(:, 2:2:num) = cos(arg); 56 | steervect(:, 3:2:num) = sin(arg); 57 | end 58 | 59 | steervect = steervect * steermtx; 60 | 61 | if (size(steervect,1) > 1) 62 | tmp = basis' .* steervect'; 63 | res = sum(tmp)'; 64 | else 65 | res = basis * steervect'; 66 | end 67 | 68 | 69 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/steer2HarmMtx.m: -------------------------------------------------------------------------------- 1 | % MTX = steer2HarmMtx(HARMONICS, ANGLES, REL_PHASES) 2 | % 3 | % Compute a steering matrix (maps a directional basis set onto the 4 | % angular Fourier harmonics). HARMONICS is a vector specifying the 5 | % angular harmonics contained in the steerable basis/filters. ANGLES 6 | % (optional) is a vector specifying the angular position of each filter. 7 | % REL_PHASES (optional, default = 'even') specifies whether the harmonics 8 | % are cosine or sine phase aligned about those positions. 9 | % The result matrix is suitable for passing to the function STEER. 10 | 11 | % Eero Simoncelli, 7/96. 12 | 13 | function mtx = steer2HarmMtx(harmonics, angles, evenorodd) 14 | 15 | %%================================================================= 16 | %%% Optional Parameters: 17 | 18 | if (exist('evenorodd') ~= 1) 19 | evenorodd = 'even'; 20 | end 21 | 22 | % Make HARMONICS a row vector 23 | harmonics = harmonics(:)'; 24 | 25 | numh = 2*size(harmonics,2) - any(harmonics == 0); 26 | 27 | if (exist('angles') ~= 1) 28 | angles = pi * [0:numh-1]'/numh; 29 | else 30 | angles = angles(:); 31 | end 32 | 33 | %%================================================================= 34 | 35 | if isstr(evenorodd) 36 | if strcmp(evenorodd,'even') 37 | evenorodd = 0; 38 | elseif strcmp(evenorodd,'odd') 39 | evenorodd = 1; 40 | else 41 | error('EVEN_OR_ODD should be the string EVEN or ODD'); 42 | end 43 | end 44 | 45 | %% Compute inverse matrix, which maps Fourier components onto 46 | %% steerable basis. 47 | imtx = zeros(size(angles,1),numh); 48 | col = 1; 49 | for h=harmonics 50 | args = h*angles; 51 | if (h == 0) 52 | imtx(:,col) = ones(size(angles)); 53 | col = col+1; 54 | elseif evenorodd 55 | imtx(:,col) = sin(args); 56 | imtx(:,col+1) = -cos(args); 57 | col = col+2; 58 | else 59 | imtx(:,col) = cos(args); 60 | imtx(:,col+1) = sin(args); 61 | col = col+2; 62 | end 63 | end 64 | 65 | r = rank(imtx); 66 | if (( r ~= numh ) & ( r ~= size(angles,1) )) 67 | fprintf(2,'WARNING: matrix is not full rank'); 68 | end 69 | 70 | mtx = pinv(imtx); 71 | 72 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/subMtx.m: -------------------------------------------------------------------------------- 1 | % MTX = subMtx(VEC, DIMENSIONS, START_INDEX) 2 | % 3 | % Reshape a portion of VEC starting from START_INDEX (optional, 4 | % default=1) to the given dimensions. 5 | 6 | % Eero Simoncelli, 6/96. 7 | 8 | function mtx = subMtx(vec, sz, offset) 9 | 10 | if (exist('offset') ~= 1) 11 | offset = 1; 12 | end 13 | 14 | vec = vec(:); 15 | sz = sz(:); 16 | 17 | if (size(sz,1) ~= 2) 18 | error('DIMENSIONS must be a 2-vector.'); 19 | end 20 | 21 | mtx = reshape( vec(offset:offset+prod(sz)-1), sz(1), sz(2) ); 22 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/upBlur.m: -------------------------------------------------------------------------------- 1 | % RES = upBlur(IM, LEVELS, FILT) 2 | % 3 | % Upsample and blur an image. The blurring is done with filter 4 | % kernel specified by FILT (default = 'binom5'), which can be a string 5 | % (to be passed to namedFilter), a vector (applied separably as a 1D 6 | % convolution kernel in X and Y), or a matrix (applied as a 2D 7 | % convolution kernel). The downsampling is always by 2 in each 8 | % direction. 9 | % 10 | % The procedure is applied recursively LEVELS times (default=1). 11 | 12 | % Eero Simoncelli, 4/97. 13 | 14 | function res = upBlur(im, nlevs, filt) 15 | 16 | %------------------------------------------------------------ 17 | %% OPTIONAL ARGS: 18 | 19 | if (exist('nlevs') ~= 1) 20 | nlevs = 1; 21 | end 22 | 23 | if (exist('filt') ~= 1) 24 | filt = 'binom5'; 25 | end 26 | 27 | %------------------------------------------------------------ 28 | 29 | if isstr(filt) 30 | filt = namedFilter(filt); 31 | end 32 | 33 | if nlevs > 1 34 | im = upBlur(im,nlevs-1,filt); 35 | end 36 | 37 | if (nlevs >= 1) 38 | if (any(size(im)==1)) 39 | if (size(im,1)==1) 40 | filt = filt'; 41 | end 42 | res = upConv(im,filt,'reflect1',(size(im)~=1)+1); 43 | elseif (any(size(filt)==1)) 44 | filt = filt(:); 45 | res = upConv(im,filt,'reflect1',[2 1]); 46 | res = upConv(res,filt','reflect1',[1 2]); 47 | else 48 | res = upConv(im,filt,'reflect1',[2 2]); 49 | end 50 | else 51 | res = im; 52 | end 53 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/upConv.m: -------------------------------------------------------------------------------- 1 | % RES = upConv(IM, FILT, EDGES, STEP, START, STOP, RES) 2 | % 3 | % Upsample matrix IM, followed by convolution with matrix FILT. These 4 | % arguments should be 1D or 2D matrices, and IM must be larger (in 5 | % both dimensions) than FILT. The origin of filt 6 | % is assumed to be floor(size(filt)/2)+1. 7 | % 8 | % EDGES is a string determining boundary handling: 9 | % 'circular' - Circular convolution 10 | % 'reflect1' - Reflect about the edge pixels 11 | % 'reflect2' - Reflect, doubling the edge pixels 12 | % 'repeat' - Repeat the edge pixels 13 | % 'zero' - Assume values of zero outside image boundary 14 | % 'extend' - Reflect and invert 15 | % 'dont-compute' - Zero output when filter overhangs OUTPUT boundaries 16 | % 17 | % Upsampling factors are determined by STEP (optional, default=[1 1]), 18 | % a 2-vector [y,x]. 19 | % 20 | % The window over which the convolution occurs is specfied by START 21 | % (optional, default=[1,1], and STOP (optional, default = 22 | % step .* (size(IM) + floor((start-1)./step))). 23 | % 24 | % RES is an optional result matrix. The convolution result will be 25 | % destructively added into this matrix. If this argument is passed, the 26 | % result matrix will not be returned. DO NOT USE THIS ARGUMENT IF 27 | % YOU DO NOT UNDERSTAND WHAT THIS MEANS!! 28 | % 29 | % NOTE: this operation corresponds to multiplication of a signal 30 | % vector by a matrix whose columns contain copies of the time-reversed 31 | % (or space-reversed) FILT shifted by multiples of STEP. See corrDn.m 32 | % for the operation corresponding to the transpose of this matrix. 33 | 34 | % Eero Simoncelli, 6/96. revised 2/97. 35 | 36 | function result = upConv(im,filt,edges,step,start,stop,res) 37 | 38 | %% THIS CODE IS NOT ACTUALLY USED! (MEX FILE IS CALLED INSTEAD) 39 | 40 | fprintf(1,'WARNING: You should compile the MEX version of "upConv.c",\n found in the MEX subdirectory of matlabPyrTools, and put it in your matlab path. It is MUCH faster, and provides more boundary-handling options.\n'); 41 | 42 | %------------------------------------------------------------ 43 | %% OPTIONAL ARGS: 44 | 45 | if (exist('edges') == 1) 46 | if (strcmp(edges,'reflect1') ~= 1) 47 | warning('Using REFLECT1 edge-handling (use MEX code for other options).'); 48 | end 49 | end 50 | 51 | if (exist('step') ~= 1) 52 | step = [1,1]; 53 | end 54 | 55 | if (exist('start') ~= 1) 56 | start = [1,1]; 57 | end 58 | 59 | % A multiple of step 60 | if (exist('stop') ~= 1) 61 | stop = step .* (floor((start-ones(size(start)))./step)+size(im)) 62 | end 63 | 64 | if ( ceil((stop(1)+1-start(1)) / step(1)) ~= size(im,1) ) 65 | error('Bad Y result dimension'); 66 | end 67 | if ( ceil((stop(2)+1-start(2)) / step(2)) ~= size(im,2) ) 68 | error('Bad X result dimension'); 69 | end 70 | 71 | if (exist('res') ~= 1) 72 | res = zeros(stop-start+1); 73 | end 74 | 75 | %------------------------------------------------------------ 76 | 77 | tmp = zeros(size(res)); 78 | tmp(start(1):step(1):stop(1),start(2):step(2):stop(2)) = im; 79 | 80 | result = rconv2(tmp,filt) + res; 81 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/upConv.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/upConv.mexa64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/upConv.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/upConv.mexglx -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/upConv.mexmac: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/upConv.mexmac -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/upConv.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/upConv.mexmaci64 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/upConv.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/VIF/matlabPyrTools-master/upConv.mexw32 -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/var2.m: -------------------------------------------------------------------------------- 1 | % V = VAR2(MTX,MEAN) 2 | % 3 | % Sample variance of a matrix. 4 | % Passing MEAN (optional) makes the calculation faster. 5 | 6 | function res = var2(mtx, mn) 7 | 8 | if (exist('mn') ~= 1) 9 | mn = mean2(mtx); 10 | end 11 | 12 | if (isreal(mtx)) 13 | res = sum(sum(abs(mtx-mn).^2)) / max((prod(size(mtx)) - 1),1); 14 | else 15 | res = sum(sum(real(mtx-mn).^2)) + i*sum(sum(imag(mtx-mn).^2)); 16 | res = res / max((prod(size(mtx)) - 1),1); 17 | end 18 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/vectify.m: -------------------------------------------------------------------------------- 1 | % [VEC] = columnize(MTX) 2 | % 3 | % Pack elements of MTX into a column vector. Just provides a 4 | % function-call notatoin for the operation MTX(:) 5 | 6 | function vec = columnize(mtx) 7 | 8 | vec = mtx(:); 9 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/vifsub_est_M.m: -------------------------------------------------------------------------------- 1 | function [g_all, vv_all]=vifsub_est_M(org,dist, subbands, M); 2 | 3 | % uses convolution for determining the parameters of the distortion channel 4 | % Called by vifvec.m 5 | 6 | tol = 1e-15; % tolernace for zero variance. Variance below this is set to zero, and zero is set to this value to avoid numerical issues. 7 | 8 | 9 | for i=1:length(subbands) 10 | sub=subbands(i); 11 | y=org{sub}; 12 | yn=dist{sub}; 13 | 14 | % compute the size of the window used in the distortion channel estimation 15 | lev=ceil((sub-1)/6); 16 | winsize=2^lev+1; offset=(winsize-1)/2; 17 | win = ones(winsize); 18 | 19 | % force subband size to be multiple of M 20 | newsize=floor(size(y)./M)*M; 21 | y=y(1:newsize(1),1:newsize(2)); 22 | yn=yn(1:newsize(1),1:newsize(2)); 23 | 24 | % Correlation with downsampling. This is faster than downsampling after 25 | % computing full correlation. 26 | winstep=[M M]; 27 | winstart=[1 1].*floor(M/2)+1; 28 | winstop=size(y)-ceil(M/2)+1; 29 | 30 | % mean 31 | mean_x = corrDn(y,win/sum(win(:)),'reflect1',winstep, winstart,winstop); 32 | mean_y = corrDn(yn,win/sum(win(:)),'reflect1',winstep, winstart,winstop); 33 | % cov 34 | cov_xy = corrDn(y.*yn, win, 'reflect1',winstep, winstart,winstop) - sum(win(:)).*mean_x.*mean_y; 35 | % var 36 | ss_x = corrDn(y.^2,win, 'reflect1',winstep, winstart,winstop) - sum(win(:)).*mean_x.^2; 37 | ss_y = corrDn(yn.^2,win, 'reflect1',winstep, winstart,winstop) - sum(win(:)).*mean_y.^2; 38 | 39 | 40 | % get rid of numerical problems, very small negative numbers, or very 41 | % small positive numbers, or other theoretical impossibilities. 42 | ss_x(ss_x<0)=0; 43 | ss_y(ss_y<0)=0; 44 | 45 | % Regression 46 | g = cov_xy./(ss_x+tol); 47 | 48 | % Variance of error in regression 49 | vv = (ss_y - g.*cov_xy)/(sum(win(:))); 50 | 51 | % get rid of numerical problems, very small negative numbers, or very 52 | % small positive numbers, or other theoretical impossibilities. 53 | g (ss_x < tol) = 0; 54 | vv (ss_x < tol) = ss_y (ss_x < tol); 55 | ss_x(ss_x nbands) | (band < 1)) 30 | error(sprintf('Bad band number (%d) should be in range [1,%d].', band, nbands)); 31 | end 32 | 33 | maxLev = wpyrHt(pind); 34 | if ((level > maxLev) | (level < 1)) 35 | error(sprintf('Bad level number (%d), should be in range [1,%d].', level, maxLev)); 36 | end 37 | 38 | band = band + nbands*(level-1); 39 | im = pyrBand(pyr,pind,band); 40 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/wpyrHt.m: -------------------------------------------------------------------------------- 1 | % [HEIGHT] = wpyrHt(INDICES) 2 | % 3 | % Compute height of separable QMF/wavelet pyramid with given index matrix. 4 | 5 | % Eero Simoncelli, 6/96. 6 | 7 | function [ht] = wpyrHt(pind) 8 | 9 | if ((pind(1,1) == 1) | (pind(1,2) ==1)) 10 | nbands = 1; 11 | else 12 | nbands = 3; 13 | end 14 | 15 | ht = (size(pind,1)-1)/nbands; 16 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/wpyrLev.m: -------------------------------------------------------------------------------- 1 | % [LEV,IND] = wpyrLev(PYR,INDICES,LEVEL) 2 | % 3 | % Access a level from a separable QMF/wavelet pyramid. 4 | % Return as an SxB matrix, B = number of bands, S = total size of a band. 5 | % Also returns an Bx2 matrix containing dimensions of the subbands. 6 | 7 | % Eero Simoncelli, 6/96. 8 | 9 | function [lev,ind] = wpyrLev(pyr,pind,level) 10 | 11 | if ((pind(1,1) == 1) | (pind(1,2) ==1)) 12 | nbands = 1; 13 | else 14 | nbands = 3; 15 | end 16 | 17 | if ((level > wpyrHt(pind)) | (level < 1)) 18 | error(sprintf('Level number must be in the range [1, %d].', wpyrHt(pind))); 19 | end 20 | 21 | firstband = 1 + nbands*(level-1) 22 | firstind = 1; 23 | for l=1:firstband-1 24 | firstind = firstind + prod(pind(l,:)); 25 | end 26 | 27 | 28 | ind = pind(firstband:firstband+nbands-1,:); 29 | lev = pyr(firstind:firstind+sum(prod(ind'))-1); 30 | 31 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/matlabPyrTools-master/zconv2.m: -------------------------------------------------------------------------------- 1 | % RES = ZCONV2(MTX1, MTX2, CTR) 2 | % 3 | % Convolution of two matrices, with boundaries handled as if the larger mtx 4 | % lies in a sea of zeros. Result will be of size of LARGER vector. 5 | % 6 | % The origin of the smaller matrix is assumed to be its center. 7 | % For even dimensions, the origin is determined by the CTR (optional) 8 | % argument: 9 | % CTR origin 10 | % 0 DIM/2 (default) 11 | % 1 (DIM/2)+1 (behaves like conv2(mtx1,mtx2,'same')) 12 | 13 | % Eero Simoncelli, 2/97. 14 | 15 | function c = zconv2(a,b,ctr) 16 | 17 | if (exist('ctr') ~= 1) 18 | ctr = 0; 19 | end 20 | 21 | if (( size(a,1) >= size(b,1) ) & ( size(a,2) >= size(b,2) )) 22 | large = a; small = b; 23 | elseif (( size(a,1) <= size(b,1) ) & ( size(a,2) <= size(b,2) )) 24 | large = b; small = a; 25 | else 26 | error('one arg must be larger than the other in both dimensions!'); 27 | end 28 | 29 | ly = size(large,1); 30 | lx = size(large,2); 31 | sy = size(small,1); 32 | sx = size(small,2); 33 | 34 | %% These values are the index of the small mtx that falls on the 35 | %% border pixel of the large matrix when computing the first 36 | %% convolution response sample: 37 | sy2 = floor((sy+ctr+1)/2); 38 | sx2 = floor((sx+ctr+1)/2); 39 | 40 | clarge = conv2(large,small); 41 | c = clarge(sy2:ly+sy2-1, sx2:lx+sx2-1); 42 | -------------------------------------------------------------------------------- /textual_attention_metrics/VIF/test.m: -------------------------------------------------------------------------------- 1 | %% vif VISUAL INFORMATION FIDELITY 2 | 3 | imorg = imread('1.bmp'); 4 | imdist = imread('2.bmp'); 5 | 6 | if size(imorg, 3) == 3 7 | imorg = rgb2gray(imorg); 8 | end 9 | 10 | if size(imdist, 3) == 3 11 | imdist = rgb2gray(imdist); 12 | end 13 | 14 | imorg = im2double(imorg); 15 | imdist = im2double(imdist); 16 | score = vifvec(imorg,imdist); -------------------------------------------------------------------------------- /textual_attention_metrics/analysis_ssim.m: -------------------------------------------------------------------------------- 1 | function [SSIM] = ssim(image1,image2,image_fused) 2 | 3 | % SSIM_a 4 | SSIM1 = ssim(image_fused,image1); 5 | SSIM2 = ssim(image_fused,image2); 6 | SSIM = (SSIM1+SSIM2)/2; 7 | 8 | end 9 | 10 | -------------------------------------------------------------------------------- /textual_attention_metrics/analysis_ssim_improved.m: -------------------------------------------------------------------------------- 1 | function [SSIM] = ssim(image1,image2,image_fused) 2 | 3 | % SSIM_a 4 | SSIM1 = ssim(image_fused,image1); 5 | SSIM2 = ssim(image_fused,image2); 6 | SSIM = SSIM1; 7 | 8 | end 9 | 10 | -------------------------------------------------------------------------------- /textual_attention_metrics/evaluation_improved.m: -------------------------------------------------------------------------------- 1 | function [evals] = evalution_improved(template, imgA, imgB, imgF) 2 | 3 | evals(1) = analysis_Qabf_improved(template,imgB,imgF); 4 | evals(2) = analysis_ssim_improved(template,imgB,imgF); 5 | evals(3) = vifvec(im2double(template),im2double(imgF)); 6 | 7 | end 8 | -------------------------------------------------------------------------------- /textual_attention_metrics/evaluation_original.m: -------------------------------------------------------------------------------- 1 | function [evals] = evalution_original(imgA, imgB, imgF) 2 | 3 | evals(1) = analysis_Qabf(imgA,imgB,imgF); 4 | evals(2) = analysis_ssim(imgA,imgB,imgF); 5 | evals(3) = (vifvec(im2double(imgA),im2double(imgF))+vifvec(im2double(imgB),im2double(imgF)))/2; 6 | 7 | end 8 | -------------------------------------------------------------------------------- /textual_attention_metrics/main_evaluation.m: -------------------------------------------------------------------------------- 1 | clear; 2 | %p = parpool('local',6); for parallel calculation 3 | currentFolder = pwd; 4 | addpath(genpath(currentFolder)); 5 | 6 | tot = 2; 7 | load('IVT_TNO_test30_textConfidence.mat'); 8 | 9 | method = 'TextFusion' 10 | fused_path = strcat("outputs_TextFusion_TNO30/"); 11 | 12 | %parfor i =1:tot , for parallel calculation 13 | for i =1:tot 14 | 15 | disp(['image:',num2str(i)]); 16 | source_ir = ['IVT_test_TNO/ir/',num2str(i),'.png']; 17 | source_vis = ['IVT_test_TNO/vis/',num2str(i),'.png']; 18 | text_guided_image_path = ['./reference_text_guided_images/TNO_test30/fuse',num2str(i),'.jpg']; 19 | image1 = imread(source_ir); 20 | image2 = imread(source_vis); 21 | text_guided_image = imread(text_guided_image_path); 22 | 23 | if size(image1, 3) == 3 24 | image1 = rgb2gray(image1); 25 | end 26 | if size(image2, 3) == 3 27 | image2 = rgb2gray(image2); 28 | end 29 | if size(text_guided_image, 3) == 3 30 | text_guided_image = rgb2gray(text_guided_image); 31 | end 32 | 33 | try 34 | fused = strcat(fused_path,"/",num2str(i),".png"); 35 | fused_image = imread(fused); 36 | catch 37 | fused = strcat(fused_path,"/",num2str(i),".jpg"); 38 | fused_image = imread(fused); 39 | end 40 | if size(fused_image, 3) == 3 41 | fused_image = rgb2gray(fused_image); 42 | end 43 | 44 | fused_image = imresize(fused_image,size(image2)); 45 | 46 | a_original(i,:) = evaluation_original(image1, image2, fused_image); 47 | a_improved(i,:) = evaluation_improved(text_guided_image, image1, image2, fused_image); 48 | a_textual(i,:) = a_original(i,:)*(1-Confidence(i)) + a_improved(i,:)*Confidence(i); 49 | end 50 | b(:) = sum(a_textual(:,:))/tot; 51 | 52 | disp(b); 53 | writetable(table(b),strcat(fused_path,"/Average_textual_",method,".xlsx"),'WriteVariableNames',false,'Sheet','Sheet1','Range','B2'); 54 | 55 | %delete(gcp('nocreate')); for parallel calculation -------------------------------------------------------------------------------- /textual_attention_metrics/outputs_TextFusion_TNO30/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/outputs_TextFusion_TNO30/1.jpg -------------------------------------------------------------------------------- /textual_attention_metrics/outputs_TextFusion_TNO30/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/outputs_TextFusion_TNO30/2.jpg -------------------------------------------------------------------------------- /textual_attention_metrics/outputs_TextFusion_TNO30/Average_textual_TextFusion.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/outputs_TextFusion_TNO30/Average_textual_TextFusion.xlsx -------------------------------------------------------------------------------- /textual_attention_metrics/reference_text_guided_images/TNO_test30/fuse1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/reference_text_guided_images/TNO_test30/fuse1.jpg -------------------------------------------------------------------------------- /textual_attention_metrics/reference_text_guided_images/TNO_test30/fuse2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AWCXV/TextFusion/d287398abc3c8bc93135bef4a3beb39b782c0f1b/textual_attention_metrics/reference_text_guided_images/TNO_test30/fuse2.jpg -------------------------------------------------------------------------------- /textual_attention_metrics/reference_text_guided_images/link_for_all_images.txt: -------------------------------------------------------------------------------- 1 | https://drive.google.com/file/d/1AQEtc1rLMqSOUOU22JZj2a8dDe2AT9fh/view?usp=drive_link --------------------------------------------------------------------------------