Skip to content

Commit

Permalink
add timestamps in demo output
Browse files Browse the repository at this point in the history
  • Loading branch information
yocabon committed Jul 23, 2024
1 parent bac527a commit 9869e71
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import tempfile

from dust3r.model import AsymmetricCroCo3DStereo
from dust3r.demo import get_args_parser, main_demo
from dust3r.demo import get_args_parser, main_demo, set_print_with_timestamp

import matplotlib.pyplot as pl
pl.ion()
Expand All @@ -20,6 +20,7 @@
if __name__ == '__main__':
parser = get_args_parser()
args = parser.parse_args()
set_print_with_timestamp()

if args.tmp_dir is not None:
tmp_path = args.tmp_dir
Expand Down
15 changes: 15 additions & 0 deletions dust3r/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# --------------------------------------------------------
import argparse
import math
import builtins
import datetime
import gradio
import os
import torch
Expand Down Expand Up @@ -48,6 +50,19 @@ def get_args_parser():
return parser


def set_print_with_timestamp(time_format="%Y-%m-%d %H:%M:%S"):
builtin_print = builtins.print

def print_with_timestamp(*args, **kwargs):
now = datetime.datetime.now()
formatted_date_time = now.strftime(time_format)

builtin_print(f'[{formatted_date_time}] ', end='') # print with time stamp
builtin_print(*args, **kwargs)

builtins.print = print_with_timestamp


def _convert_scene_output_to_glb(outdir, imgs, pts3d, mask, focals, cams2world, cam_size=0.05,
cam_color=None, as_pointcloud=False,
transparent_cams=False, silent=False):
Expand Down

0 comments on commit 9869e71

Please sign in to comment.