Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AstroVision working for instant-ngp #3434

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions compute_metrics.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from PIL import Image\n",
"\n",
"\n",
"plt.rcParams\n",
"\n",
"\n",
"RENDER_ROOT = \"/home/tdriver6/Documents/nerfstudio/renders/train/rgb\"\n",
"GT_ROOT = \"/home/tdriver6/Documents/nerfstudio/data/nerfstudio/aspct_ahunamons/images\"\n",
"\n",
"render_paths = os.listdir(RENDER_ROOT)\n",
"psnrs = []\n",
"for pth in render_paths:\n",
" if not pth.endswith(\".png\"):\n",
" continue\n",
" print(os.path.join(RENDER_ROOT, pth))\n",
" rend = np.asarray(Image.open(os.path.join(RENDER_ROOT, pth)).convert(\"L\"))\n",
" gt = np.asarray(Image.open(os.path.join(GT_ROOT, pth)).convert(\"L\"))\n",
"\n",
" plt.imshow((gt - rend) ** 2, cmap=\"jet\")\n",
" plt.colorbar()\n",
" plt.show()\n",
"\n",
" plt.imshow(rend, cmap=\"gray\")\n",
" plt.colorbar()\n",
" plt.show()\n",
"\n",
"\n",
" mse = np.mean((gt - rend) ** 2)\n",
" psnrs.append(10 * np.log10(gt.max() ** 2 / mse))\n",
" print(psnrs[-1])\n",
"\n",
"print(\"Mean PSNR: %.2f\" % np.mean(psnrs))\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.8.19 ('nerfstudio')",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.19"
},
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "d1bb290f7ef6eb618af297cbac6e2293d0f49bb9d3bac6de88ea6e7f4e095596"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
3 changes: 2 additions & 1 deletion nerfstudio/configs/dataparser_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
from typing import TYPE_CHECKING

import tyro

from nerfstudio.data.dataparsers.arkitscenes_dataparser import ARKitScenesDataParserConfig
from nerfstudio.data.dataparsers.astrovision_dataparser import AstroVisionDataParserConfig
from nerfstudio.data.dataparsers.base_dataparser import DataParserConfig
from nerfstudio.data.dataparsers.blender_dataparser import BlenderDataParserConfig
from nerfstudio.data.dataparsers.colmap_dataparser import ColmapDataParserConfig
Expand All @@ -40,6 +40,7 @@

dataparsers = {
"nerfstudio-data": NerfstudioDataParserConfig(),
"astrovision-data": AstroVisionDataParserConfig(),
"minimal-parser": MinimalDataParserConfig(),
"arkit-data": ARKitScenesDataParserConfig(),
"blender-data": BlenderDataParserConfig(),
Expand Down
Loading