Skip to content
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
4 changes: 2 additions & 2 deletions code/DiffSynth-Studio/diffsynth/extensions/FastBlend/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def smooth_video(
# output
try:
fps = int(fps)
except:
except Exception:
fps = get_video_fps(video_style) if video_style is not None else 30
print("Fps:", fps)
print("Saving video...")
Expand Down Expand Up @@ -243,7 +243,7 @@ def interpolate_video(
InterpolationModeRunner().run(frames_guide, frames_style, index_style, batch_size=batch_size, ebsynth_config=ebsynth_config, save_path=output_frames_path)
try:
fps = int(fps)
except:
except Exception:
fps = 30
print("Fps:", fps)
print("Saving video...")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def bpe(self, token):
j = word.index(first, i)
new_word.extend(word[i:j])
i = j
except:
except Exception:
new_word.extend(word[i:])
break

Expand Down
2 changes: 1 addition & 1 deletion code/DiffSynth-Studio/diffsynth/models/lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def match(self, model, state_dict_lora):
break
else:
return lora_prefix, model_resource
except:
except Exception:
pass
return None

Expand Down
2 changes: 1 addition & 1 deletion code/DiffSynth-Studio/diffsynth/models/model_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def load_model_from_huggingface_folder(file_path, model_names, model_classes, to
model = model.half()
try:
model = model.to(device=device)
except:
except Exception:
pass
loaded_model_names.append(model_name)
loaded_models.append(model)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __getitem__(self, index):
video_file = self.path[data_id]
try:
data = self.load_video(video_file, training_shape_id)
except:
except Exception:
data = None
if data is not None:
break
Expand Down
2 changes: 1 addition & 1 deletion code/MoGe/moge/utils/webzipfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,6 @@ def open(self, name, mode="r", pwd=None, *, force_zip64=False):
pwd = None

return ZipExtFile(zef_file, mode, zinfo, pwd, True)
except:
except Exception:
zef_file.close()
raise
6 changes: 3 additions & 3 deletions code/Pano_GS_Opt/gaussian_renderer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def render(viewpoint_camera, pc : GaussianModel, pipe, bg_color : torch.Tensor,
screenspace_points = torch.zeros_like(pc.get_xyz, dtype=pc.get_xyz.dtype, requires_grad=True, device="cuda") + 0
try:
screenspace_points.retain_grad()
except:
except Exception:
pass

# Set up rasterization configuration
Expand Down Expand Up @@ -124,7 +124,7 @@ def render_new(viewpoint_camera, pc : GaussianModel, pipe, bg_color : torch.Tens
screenspace_points = torch.zeros_like(pc.get_xyz, dtype=pc.get_xyz.dtype, requires_grad=True, device="cuda") + 0
try:
screenspace_points.retain_grad()
except:
except Exception:
pass

# Set up rasterization configuration
Expand Down Expand Up @@ -206,7 +206,7 @@ def integrate(points3D, viewpoint_camera, pc : GaussianModel, pipe, bg_color : t
screenspace_points = torch.zeros_like(pc.get_xyz, dtype=pc.get_xyz.dtype, requires_grad=True, device="cuda") + 0
try:
screenspace_points.retain_grad()
except:
except Exception:
pass

# Set up rasterization configuration
Expand Down
2 changes: 1 addition & 1 deletion code/Pano_GS_Opt/mesh_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def load_and_show_ply2(filepath):
try:
# Try loading as a point cloud first
mesh = o3d.io.read_point_cloud(filepath)
except:
except Exception:
# If that fails, try loading as a triangle mesh
mesh = o3d.io.read_triangle_mesh(filepath)
mesh.compute_vertex_normals()
Expand Down
2 changes: 1 addition & 1 deletion code/Pano_GS_Opt/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def evaluate(model_paths, scale):
json.dump(full_dict[scene_dir], fp, indent=True)
with open(scene_dir + "/per_view.json", 'w') as fp:
json.dump(per_view_dict[scene_dir], fp, indent=True)
except:
except Exception:
print("Unable to compute metrics for model", scene_dir)

if __name__ == "__main__":
Expand Down
12 changes: 6 additions & 6 deletions code/Pano_GS_Opt/scene/dataset_readers.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def readColmapSceneInfo(path, images, eval, llffhold=8):
cameras_intrinsic_file = os.path.join(path, "sparse/0", "cameras.bin")
cam_extrinsics = read_extrinsics_binary(cameras_extrinsic_file)
cam_intrinsics = read_intrinsics_binary(cameras_intrinsic_file)
except:
except Exception:
cameras_extrinsic_file = os.path.join(path, "sparse/0", "images.txt")
cameras_intrinsic_file = os.path.join(path, "sparse/0", "cameras.txt")
cam_extrinsics = read_extrinsics_text(cameras_extrinsic_file)
Expand All @@ -171,12 +171,12 @@ def readColmapSceneInfo(path, images, eval, llffhold=8):
print("Converting point3d.bin to .ply, will happen only the first time you open the scene.")
try:
xyz, rgb, _ = read_points3D_binary(bin_path)
except:
except Exception:
xyz, rgb, _ = read_points3D_text(txt_path)
storePly(ply_path, xyz, rgb)
try:
pcd = fetchPly(ply_path)
except:
except Exception:
pcd = None

scene_info = SceneInfo(point_cloud=pcd,
Expand Down Expand Up @@ -254,7 +254,7 @@ def readNerfSyntheticInfo(path, white_background, eval, extension=".png"):
storePly(ply_path, xyz, SH2RGB(shs) * 255)
try:
pcd = fetchPly(ply_path)
except:
except Exception:
pcd = None

scene_info = SceneInfo(point_cloud=pcd,
Expand Down Expand Up @@ -338,7 +338,7 @@ def readMultiScaleNerfSyntheticInfo(path, white_background, eval, load_allres=Fa
storePly(ply_path, xyz, SH2RGB(shs) * 255)
try:
pcd = fetchPly(ply_path)
except:
except Exception:
pcd = None

scene_info = SceneInfo(point_cloud=pcd,
Expand Down Expand Up @@ -741,7 +741,7 @@ def depths_to_points(world_view_transform, W, H, fov,fovY, depthmap):
storePly(ply_path, xyz, SH2RGB(shs) * 255)
try:
pcd = fetchPly(ply_path)
except:
except Exception:
pcd = None

scene_info = SceneInfo(point_cloud=pcd,
Expand Down
2 changes: 1 addition & 1 deletion code/Pano_LRM/dataset/dust3r/cloud_opt/pair_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(self, *args, **kwargs):

R = cv2.Rodrigues(R)[0] # world to cam
pose = inv(np.r_[np.c_[R, T], [(0, 0, 0, 1)]]) # cam to world
except:
except Exception:
pose = np.eye(4)
rel_poses.append(torch.from_numpy(pose.astype(np.float32)))

Expand Down
2 changes: 1 addition & 1 deletion code/Pano_LRM/sgm/gsrenderer/gs_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ def render_opencv_cam(
)
# try:
# screenspace_points.retain_grad()
# except:
# except Exception:
# pass

viewpoint_camera = Camera(C2W=C2W, fxfycxcy=fxfycxcy, h=height, w=width)
Expand Down
2 changes: 1 addition & 1 deletion code/Pano_LRM/sgm/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def get_string_from_tuple(s):
return t[0]
else:
pass
except:
except Exception:
pass
return s

Expand Down
2 changes: 1 addition & 1 deletion code/Pano_LRM/sgm/webds.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, urls, seed, nshards=sys.maxsize, deterministic=True):

group = get_data_parallel_group()
print_rank0("Using megatron data parallel group.")
except:
except Exception:
from sat.mpu import get_data_parallel_group

try:
Expand Down
4 changes: 2 additions & 2 deletions code/StableSR/ldm/models/diffusion/ddpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ def __init__(self,
self.cond_stage_key = cond_stage_key
try:
self.num_downs = len(first_stage_config.params.ddconfig.ch_mult) - 1
except:
except Exception:
self.num_downs = 0
if not scale_by_std:
self.scale_factor = scale_factor
Expand Down Expand Up @@ -1606,7 +1606,7 @@ def __init__(self,
self.cond_stage_key = cond_stage_key
try:
self.num_downs = len(first_stage_config.params.ddconfig.ch_mult) - 1
except:
except Exception:
self.num_downs = 0
if not scale_by_std:
self.scale_factor = scale_factor
Expand Down
2 changes: 1 addition & 1 deletion code/StableSR/ldm/models/diffusion/ddpm_inv.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def __init__(self,

try:
self.num_downs = len(first_stage_config.params.ddconfig.ch_mult) - 1
except:
except Exception:
self.num_downs = 0
if not scale_by_std:
self.scale_factor = scale_factor
Expand Down
2 changes: 1 addition & 1 deletion code/StableSR/ldm/modules/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import xformers
import xformers.ops
XFORMERS_IS_AVAILBLE = True
except:
except Exception:
XFORMERS_IS_AVAILBLE = False

# CrossAttn precision handling
Expand Down
2 changes: 1 addition & 1 deletion code/StableSR/ldm/modules/diffusionmodules/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import xformers
import xformers.ops
XFORMERS_IS_AVAILBLE = True
except:
except Exception:
XFORMERS_IS_AVAILBLE = False

def calc_mean_std(feat, eps=1e-5):
Expand Down
2 changes: 1 addition & 1 deletion code/StableSR/ldm/modules/diffusionmodules/openaimodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import xformers
import xformers.ops
XFORMERS_IS_AVAILBLE = True
except:
except Exception:
XFORMERS_IS_AVAILBLE = False

from ldm.modules.diffusionmodules.util import (
Expand Down
2 changes: 1 addition & 1 deletion code/StableSR/scripts/util_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def imread(path, chn='rgb', dtype='float32'):
im = np.stack((im, im, im), axis=2)
elif chn.lower() == 'gray':
assert im.ndim == 2
except:
except Exception:
print(str(path))

if dtype == 'float32':
Expand Down
2 changes: 1 addition & 1 deletion code/pano_init/i2p_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def inpaint_img(self, img_path,seed=42,prompt=None,fov=None):
prompt = prompt
else:
prompt = self.Lamma_Video.extract_prompt(img_path,debug=True)
except:
except Exception:
print("Lamma Video prompt failed")
promt="a lot of trees"
print(f"Lamma Video prompt {prompt}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

try:
from diffusers.models.autoencoders.vae import DecoderOutput
except:
except Exception:
from diffusers.models.vae import DecoderOutput

if is_torch_xla_available():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

try:
from diffusers.models.autoencoders.vae import DecoderOutput
except:
except Exception:
from diffusers.models.vae import DecoderOutput

if is_torch_xla_available():
Expand Down
2 changes: 1 addition & 1 deletion code/pano_init/utils/pipeline_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

try:
from diffusers.models.autoencoders.vae import DecoderOutput
except:
except Exception:
from diffusers.models.vae import DecoderOutput

if is_torch_xla_available():
Expand Down