compare.ipynb 1.98 KB
Newer Older
Nianchen Deng's avatar
sync    
Nianchen Deng committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "import os\n",
    "import torch\n",
    "import matplotlib.pyplot as plt\n",
    "import torchvision.transforms.functional as trans_f\n",
    "\n",
    "sys.path.append(os.path.abspath(sys.path[0] + '/../../'))\n",
    "__package__ = \"deep_view_syn.notebook\"\n",
    "\n",
    "from ..my import util\n",
    "\n",
    "path_patts = [\n",
    "    '/home/dengnc/deep_view_syn/data/gas_fovea_2020.12.31/upsampling_test/gt/view_%04d.png',\n",
    "    '/home/dengnc/deep_view_syn/data/gas_fovea_2020.12.31/fovea_rgb@msl-rgb_e10_fc256x4_d1-50_s16/output/model-epoch_500/train/out_view_%04d.png',\n",
    "    '/home/dengnc/deep_view_syn/data/gas_fovea_2020.12.31/upsampling_test/input/out_view_%04d.png',\n",
    "    '/home/dengnc/deep_view_syn/data/gas_fovea_2020.12.31/upsampling_test/output/view_%04d.png'\n",
    "]\n",
    "titles = [ 'Ground truth', 'Normal', 'Low Res', 'Upsampling']\n",
    "show_range = range(5)\n",
    "\n",
    "#os.chdir('/home/dengnc/deep_view_syn/data/')\n",
    "image_seqs = [\n",
    "    util.ReadImageTensor([path_patt % i for i in show_range])\n",
    "    for path_patt in path_patts\n",
    "]\n",
    "\n",
    "for i in show_range:\n",
    "    plt.figure(facecolor='white', figsize=(12, 4))\n",
    "    plt.suptitle('View %d' % i)\n",
    "    for j in range(len(image_seqs)):\n",
    "        plt.subplot(1, len(image_seqs), j + 1)\n",
    "        plt.title(titles[j])\n",
    "        util.PlotImageTensor(image_seqs[j][i])\n",
    "    \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "name": "python3"
  },
  "language_info": {
   "name": "python",
   "nbconvert_exporter": "python",
   "version": "3.7.9-final"
  },
  "orig_nbformat": 2
 },
 "nbformat": 4,
 "nbformat_minor": 2
}