Change warnings.simplefilter to filterwarnings
parent
798737ae78
commit
ac2da7e9bf
|
|
@ -2,11 +2,12 @@ import os
|
||||||
|
|
||||||
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
|
os.environ["PYTORCH_ENABLE_MPS_FALLBACK"] = "1"
|
||||||
|
|
||||||
import warnings
|
import warnings # noqa: E402
|
||||||
|
|
||||||
warnings.simplefilter("ignore", UserWarning)
|
warnings.filterwarnings("ignore", category=UserWarning, module="pydantic")
|
||||||
|
warnings.filterwarnings("ignore", category=UserWarning, module="lama_cleaner")
|
||||||
|
|
||||||
from lama_cleaner.parse_args import parse_args
|
from lama_cleaner.parse_args import parse_args # noqa: E402
|
||||||
|
|
||||||
|
|
||||||
def entry_point():
|
def entry_point():
|
||||||
|
|
|
||||||
|
|
@ -4,16 +4,14 @@
|
||||||
# This source code is licensed under the license found in the
|
# This source code is licensed under the license found in the
|
||||||
# LICENSE file in the root directory of this source tree.
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
from .build_sam import (
|
import warnings
|
||||||
build_sam,
|
|
||||||
build_sam_vit_h,
|
warnings.filterwarnings("ignore", category=UserWarning, module="mobile_sam")
|
||||||
build_sam_vit_l,
|
|
||||||
build_sam_vit_b,
|
from .automatic_mask_generator import SamAutomaticMaskGenerator # noqa: E402
|
||||||
build_sam_vit_t,
|
from .build_sam import (build_sam, build_sam_vit_b, build_sam_vit_h, build_sam_vit_l, # noqa: E402
|
||||||
sam_model_registry,
|
build_sam_vit_t, sam_model_registry)
|
||||||
)
|
from .predictor import SamPredictor # noqa: E402
|
||||||
from .predictor import SamPredictor
|
|
||||||
from .automatic_mask_generator import SamAutomaticMaskGenerator
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"build_sam",
|
"build_sam",
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
# --------------------------------------------------------
|
# --------------------------------------------------------
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
import warnings
|
|
||||||
from typing import Tuple
|
from typing import Tuple
|
||||||
|
|
||||||
import torch
|
import torch
|
||||||
|
|
@ -19,8 +18,6 @@ from timm.models.layers import DropPath as TimmDropPath
|
||||||
from timm.models.layers import to_2tuple, trunc_normal_
|
from timm.models.layers import to_2tuple, trunc_normal_
|
||||||
from timm.models.registry import register_model
|
from timm.models.registry import register_model
|
||||||
|
|
||||||
warnings.simplefilter("ignore", category=UserWarning)
|
|
||||||
|
|
||||||
|
|
||||||
class Conv2d_BN(torch.nn.Sequential):
|
class Conv2d_BN(torch.nn.Sequential):
|
||||||
def __init__(self, a, b, ks=1, stride=1, pad=0, dilation=1,
|
def __init__(self, a, b, ks=1, stride=1, pad=0, dilation=1,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue