python_code stringlengths 0 992k | repo_name stringlengths 8 46 | file_path stringlengths 5 162 |
|---|---|---|
import torch
import types
import os
from tqdm import tqdm
import numpy as np
from detectron2.config import get_cfg
from detectron2.data.detection_utils import read_image
from detectron2.projects.deeplab import add_deeplab_config
import glob
from mask2former import add_maskformer2_config
from predictor import Visualiza... | 3D-LLM-main | three_steps_3d_feature/first_step/maskformer_mask.py |
import os
from pathlib import Path
import cv2
import numpy as np
import open_clip
import torch
from segment_anything import SamAutomaticMaskGenerator, SamPredictor, sam_model_registry
from tqdm import tqdm, trange
import glob
import argparse
from tqdm import tqdm
def main():
parser = argparse.ArgumentParser(des... | 3D-LLM-main | three_steps_3d_feature/first_step/sam_mask.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import copy
import logging
from itertools import count
import numpy as np
import torch
from fvcore.transforms import HFlipTransform
from torch import nn
from torch.nn.parallel import DistributedDataParallel
from detectron2.data.detection_utils import read_image
from ... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/test_time_augmentation.py |
# -*- coding: utf-8 -*-
# Copyright (c) Facebook, Inc. and its affiliates.
from detectron2.config import CfgNode as CN
def add_maskformer2_config(cfg):
"""
Add config for MASK_FORMER.
"""
# NOTE: configs from original maskformer
# data config
# select the dataset mapper
cfg.INPUT.DATASET_M... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/config.py |
# Copyright (c) Facebook, Inc. and its affiliates.
from typing import Tuple
import torch
from torch import nn
from torch.nn import functional as F
from detectron2.config import configurable
from detectron2.data import MetadataCatalog
from detectron2.modeling import META_ARCH_REGISTRY, build_backbone, build_sem_seg_he... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/maskformer_model.py |
# Copyright (c) Facebook, Inc. and its affiliates.
from . import data # register all new datasets
from . import modeling
# config
from .config import add_maskformer2_config
# dataset loading
from .data.dataset_mappers.coco_instance_new_baseline_dataset_mapper import COCOInstanceNewBaselineDatasetMapper
from .data.da... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# Modified by Bowen Cheng from https://github.com/facebookresearch/detr/blob/master/util/misc.py
"""
Misc functions, including distributed helpers.
Mostly copy-paste from torchvision references.
"""
from typing import List, Optional
import torch
import torch.distribu... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/utils/misc.py |
# Copyright (c) Facebook, Inc. and its affiliates.
| 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/utils/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# Modified by Bowen Cheng from https://github.com/facebookresearch/detr/blob/master/models/matcher.py
"""
Modules to compute the matching cost and solve the corresponding LSAP.
"""
import torch
import torch.nn.functional as F
from scipy.optimize import linear_sum_assig... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/matcher.py |
# Copyright (c) Facebook, Inc. and its affiliates.
from .backbone.swin import D2SwinTransformer
from .pixel_decoder.fpn import BasePixelDecoder
from .pixel_decoder.msdeformattn import MSDeformAttnPixelDecoder
from .meta_arch.mask_former_head import MaskFormerHead
from .meta_arch.per_pixel_baseline import PerPixelBaseli... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# Modified by Bowen Cheng from https://github.com/facebookresearch/detr/blob/master/models/detr.py
"""
MaskFormer criterion.
"""
import logging
import torch
import torch.nn.functional as F
from torch import nn
from detectron2.utils.comm import get_world_size
from det... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/criterion.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# Modified by Bowen Cheng from: https://github.com/facebookresearch/detr/blob/master/models/detr.py
import fvcore.nn.weight_init as weight_init
import torch
from torch import nn
from torch.nn import functional as F
from detectron2.config import configurable
from detec... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/transformer_decoder/maskformer_transformer_decoder.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# Modified by Bowen Cheng from: https://github.com/facebookresearch/detr/blob/master/models/detr.py
import logging
import fvcore.nn.weight_init as weight_init
from typing import Optional
import torch
from torch import nn, Tensor
from torch.nn import functional as F
fr... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/transformer_decoder/mask2former_transformer_decoder.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# # Modified by Bowen Cheng from: https://github.com/facebookresearch/detr/blob/master/models/position_encoding.py
"""
Various positional encodings for the transformer.
"""
import math
import torch
from torch import nn
class PositionEmbeddingSine(nn.Module):
"""... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/transformer_decoder/position_encoding.py |
# Copyright (c) Facebook, Inc. and its affiliates.
from .maskformer_transformer_decoder import StandardTransformerDecoder
from .mask2former_transformer_decoder import MultiScaleMaskedTransformerDecoder
| 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/transformer_decoder/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# Modified by Bowen Cheng from: https://github.com/facebookresearch/detr/blob/master/models/transformer.py
"""
Transformer class.
Copy-paste from torch.nn.Transformer with modifications:
* positional encodings are passed in MHattention
* extra LN at the end of... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/transformer_decoder/transformer.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import logging
import numpy as np
from typing import Callable, Dict, List, Optional, Tuple, Union
import fvcore.nn.weight_init as weight_init
import torch
from torch import nn
from torch.nn import functional as F
from torch.nn.init import xavier_uniform_, constant_, u... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/pixel_decoder/fpn.py |
# Copyright (c) Facebook, Inc. and its affiliates.
| 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/pixel_decoder/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import logging
import numpy as np
from typing import Callable, Dict, List, Optional, Tuple, Union
import fvcore.nn.weight_init as weight_init
import torch
from torch import nn
from torch.nn import functional as F
from torch.nn.init import xavier_uniform_, constant_, u... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/pixel_decoder/msdeformattn.py |
# ------------------------------------------------------------------------------------------------
# Deformable DETR
# Copyright (c) 2020 SenseTime. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# -------------------------------------------------------------------------... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/pixel_decoder/ops/test.py |
# ------------------------------------------------------------------------------------------------
# Deformable DETR
# Copyright (c) 2020 SenseTime. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# -------------------------------------------------------------------------... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/pixel_decoder/ops/setup.py |
# ------------------------------------------------------------------------------------------------
# Deformable DETR
# Copyright (c) 2020 SenseTime. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# -------------------------------------------------------------------------... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/pixel_decoder/ops/functions/ms_deform_attn_func.py |
# ------------------------------------------------------------------------------------------------
# Deformable DETR
# Copyright (c) 2020 SenseTime. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# -------------------------------------------------------------------------... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/pixel_decoder/ops/functions/__init__.py |
# ------------------------------------------------------------------------------------------------
# Deformable DETR
# Copyright (c) 2020 SenseTime. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# -------------------------------------------------------------------------... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/pixel_decoder/ops/modules/ms_deform_attn.py |
# ------------------------------------------------------------------------------------------------
# Deformable DETR
# Copyright (c) 2020 SenseTime. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
# -------------------------------------------------------------------------... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/pixel_decoder/ops/modules/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import logging
from copy import deepcopy
from typing import Callable, Dict, List, Optional, Tuple, Union
import fvcore.nn.weight_init as weight_init
from torch import nn
from torch.nn import functional as F
from detectron2.config import configurable
from detectron2.l... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/meta_arch/mask_former_head.py |
# Copyright (c) Facebook, Inc. and its affiliates.
| 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/meta_arch/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import logging
from typing import Callable, Dict, List, Optional, Tuple, Union
import fvcore.nn.weight_init as weight_init
from torch import nn
from torch.nn import functional as F
from detectron2.config import configurable
from detectron2.layers import Conv2d, Shape... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/meta_arch/per_pixel_baseline.py |
# --------------------------------------------------------
# Swin Transformer
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ze Liu, Yutong Lin, Yixuan Wei
# --------------------------------------------------------
# Copyright (c) Facebook, Inc. and its affiliate... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/backbone/swin.py |
# Copyright (c) Facebook, Inc. and its affiliates.
| 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/modeling/backbone/__init__.py |
3D-LLM-main | three_steps_3d_feature/first_step/mask2former/evaluation/__init__.py | |
# Copyright (c) Facebook, Inc. and its affiliates.
import contextlib
import copy
import io
import itertools
import json
import logging
import numpy as np
import os
import pickle
from collections import OrderedDict
import pycocotools.mask as mask_util
import torch
from pycocotools.coco import COCO
from pycocotools.cocoe... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/evaluation/instance_evaluation.py |
# Copyright (c) Facebook, Inc. and its affiliates.
from . import datasets
| 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
| 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/dataset_mappers/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# Modified by Bowen Cheng from https://github.com/facebookresearch/detr/blob/master/d2/detr/dataset_mapper.py
import copy
import logging
import numpy as np
import torch
from detectron2.config import configurable
from detectron2.data import detection_utils as utils
fr... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/dataset_mappers/coco_panoptic_new_baseline_dataset_mapper.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import copy
import logging
import numpy as np
import torch
from torch.nn import functional as F
from detectron2.config import configurable
from detectron2.data import MetadataCatalog
from detectron2.data import detection_utils as utils
from detectron2.data import tra... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/dataset_mappers/mask_former_semantic_dataset_mapper.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import copy
import logging
import numpy as np
import torch
from torch.nn import functional as F
from detectron2.config import configurable
from detectron2.data import detection_utils as utils
from detectron2.data import transforms as T
from detectron2.structures impo... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/dataset_mappers/mask_former_panoptic_dataset_mapper.py |
# Copyright (c) Facebook, Inc. and its affiliates.
# Modified by Bowen Cheng from https://github.com/facebookresearch/detr/blob/master/d2/detr/dataset_mapper.py
import copy
import logging
import numpy as np
import torch
from detectron2.config import configurable
from detectron2.data import detection_utils as utils
fr... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/dataset_mappers/coco_instance_new_baseline_dataset_mapper.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import copy
import logging
import numpy as np
import pycocotools.mask as mask_util
import torch
from torch.nn import functional as F
from detectron2.config import configurable
from detectron2.data import detection_utils as utils
from detectron2.data import transforms... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/dataset_mappers/mask_former_instance_dataset_mapper.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import os
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.data.datasets import load_sem_seg
ADE20K_SEM_SEG_FULL_CATEGORIES = [
{"name": "wall", "id": 2978, "trainId": 0},
{"name": "building, edifice", "id": 312, "trainId": 1},
... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/datasets/register_ade20k_full.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import os
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.data.datasets import load_sem_seg
MAPILLARY_VISTAS_SEM_SEG_CATEGORIES = [
{
"color": [165, 42, 42],
"instances": True,
"readable": "Bird",
"name"... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/datasets/register_mapillary_vistas.py |
# Copyright (c) Facebook, Inc. and its affiliates.
from . import (
register_ade20k_full,
register_ade20k_panoptic,
register_coco_stuff_10k,
register_mapillary_vistas,
register_coco_panoptic_annos_semseg,
register_ade20k_instance,
register_mapillary_vistas_panoptic,
)
| 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/datasets/__init__.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import json
import os
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.utils.file_io import PathManager
MAPILLARY_VISTAS_SEM_SEG_CATEGORIES = [
{'color': [165, 42, 42],
'id': 1,
'isthing': 1,
'name': 'Bird',
'supercateg... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/datasets/register_mapillary_vistas_panoptic.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import json
import logging
import numpy as np
import os
from PIL import Image
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.data.datasets.coco import load_coco_json, register_coco_instances
from detectron2.utils.file_io import PathManager... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/datasets/register_ade20k_instance.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import json
import os
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.data.datasets import load_sem_seg
from detectron2.data.datasets.builtin_meta import COCO_CATEGORIES
from detectron2.utils.file_io import PathManager
_PREDEFINED_SPLITS_... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/datasets/register_coco_panoptic_annos_semseg.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import json
import os
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.utils.file_io import PathManager
ADE20K_150_CATEGORIES = [
{"color": [120, 120, 120], "id": 0, "isthing": 0, "name": "wall"},
{"color": [180, 120, 120], "id": 1,... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/datasets/register_ade20k_panoptic.py |
# Copyright (c) Facebook, Inc. and its affiliates.
import os
from detectron2.data import DatasetCatalog, MetadataCatalog
from detectron2.data.datasets import load_sem_seg
COCO_CATEGORIES = [
{"color": [220, 20, 60], "isthing": 1, "id": 1, "name": "person"},
{"color": [119, 11, 32], "isthing": 1, "id": 2, "nam... | 3D-LLM-main | three_steps_3d_feature/first_step/mask2former/data/datasets/register_coco_stuff_10k.py |
import torch
import torchvision
import cv2
import numpy as np
from tqdm import tqdm
import os
from torch import nn
import argparse
import clip
import open_clip
LOAD_IMG_HEIGHT = 512
LOAD_IMG_WIDTH = 512
from PIL import Image
def get_bbox_around_mask(mask):
bbox = None
nonzero_inds = torch.nonzero(mask) # (n... | 3D-LLM-main | three_steps_3d_feature/second_step/clip_maskformer.py |
import torch
import torchvision
import cv2
import numpy as np
from tqdm import tqdm
import os
from torch import nn
from lavis.models.eva_vit import create_eva_vit_g
import argparse
LOAD_IMG_HEIGHT = 512
LOAD_IMG_WIDTH = 512
def get_bbox_around_mask(mask):
# mask: (img_height, img_width)
# compute bbox around... | 3D-LLM-main | three_steps_3d_feature/second_step/blip_sam.py |
import torch
import torchvision
import cv2
import numpy as np
from tqdm import tqdm
import os
from torch import nn
from lavis.models.eva_vit import create_eva_vit_g
import argparse
LOAD_IMG_HEIGHT = 512
LOAD_IMG_WIDTH = 512
def get_bbox_around_mask(mask):
bbox = None
nonzero_inds = torch.nonzero(mask) # (nu... | 3D-LLM-main | three_steps_3d_feature/second_step/blip_maskformer.py |
import torch
import torchvision
import cv2
import numpy as np
from tqdm import tqdm
import os
from torch import nn
import argparse
import clip
import open_clip
LOAD_IMG_HEIGHT = 512
LOAD_IMG_WIDTH = 512
from PIL import Image
def get_bbox_around_mask(mask):
# mask: (img_height, img_width)
# compute bbox aroun... | 3D-LLM-main | three_steps_3d_feature/second_step/clip_sam.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
import sys
from omegaconf import OmegaConf
from lavis.common.registry import registry
... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/__init__.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import logging
import os
import torch
import torch.distributed as dist
from lavis.common.dist_uti... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/tasks/base_task.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
from lavis.common.registry import registry
from lavis.tasks.base_task import BaseTask
from lavis.t... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/tasks/__init__.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import json
import logging
import os
import numpy as np
import torch
from lavis.common.dist_utils... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/tasks/retrieval.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
from lavis.common.registry import registry
from lavis.tasks.base_task import BaseTask
@registry.... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/tasks/image_text_pretrain.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import json
import os
from lavis.common.dist_utils import main_process
from lavis.common.logger i... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/tasks/dialogue.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import json
import os
from lavis.common.dist_utils import main_process
from lavis.common.registry... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/tasks/captioning.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import logging
import json
import os
import lavis.common.dist_utils as dist_utils
from lavis.comm... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/tasks/vqa.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import logging
import json
import os
import torch
import torch.distributed as dist
from itertools ... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/tasks/vqa_reading_comprehension.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import json
import os
import logging
import numpy as np
import torch
from lavis.common.dist_utils... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/tasks/multimodal_classification.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import gzip
import logging
import os
import random as rnd
import tarfile
import zipfile
import de... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/data_utils.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
from lavis.common.registry import registry
from lavis.datasets.builders.base_dataset_bu... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/builders/imagefolder_builder.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import logging
import os
import shutil
import warnings
import lavis.common.utils as utils
import ... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/builders/base_dataset_builder.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
from lavis.common.registry import registry
from lavis.common.utils import get_cache_path
from lavi... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/builders/video_qa_builder.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
from lavis.datasets.builders.base_dataset_builder import load_dataset_config
from lavis.datasets.b... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/builders/__init__.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
from lavis.datasets.builders.base_dataset_builder import BaseDatasetBuilder
from lavis.datasets.da... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/builders/retrieval_builder.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
from lavis.datasets.builders.base_dataset_builder import BaseDatasetBuilder
from lavis.common.reg... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/builders/vqa_builder.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
from lavis.common.registry import registry
from lavis.datasets.builders.base_dataset_builder impor... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/builders/dialogue_builder.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
from lavis.common.registry import registry
from lavis.datasets.builders.base_dataset_bu... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/builders/image_text_pair_builder.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
from lavis.datasets.builders.base_dataset_builder import BaseDatasetBuilder
from lavis.datasets.da... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/builders/caption_builder.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
from lavis.common.registry import registry
from lavis.datasets.builders.base_dataset_builder impor... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/builders/classification_builder.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
from collections import OrderedDict
from lavis.datasets.datasets.base_dataset import Ba... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/imagefolder_dataset.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import webdataset as wds
from lavis.datasets.datasets.base_dataset import BaseDataset
class Laio... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/laion_dataset.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import json
from typing import Iterable
from torch.utils.data import Dataset, ConcatDataset
from ... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/base_dataset.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
import random
from collections import OrderedDict
from lavis.datasets.datasets.multimo... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/nlvr_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import time
import random
import torch
from lavis.datasets.data_utils import move_to_cuda
from tor... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/dataloader_utils.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
from PIL import Image
from lavis.datasets.datasets.vqa_datasets import VQADataset
cl... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/vg_vqa_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
from abc import abstractmethod
from lavis.datasets.datasets.base_dataset import BaseDataset
clas... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/multimodal_classification_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
from collections import OrderedDict
from lavis.datasets.datasets.base_dataset import Ba... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/image_text_pair_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
from lavis.datasets.datasets.base_dataset import BaseDataset
from lavis.datasets.datase... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/video_caption_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import json
import os
from collections import OrderedDict
from lavis.datasets.datasets.multimodal... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/video_vqa_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
from collections import OrderedDict
from PIL import Image
from lavis.datasets.datasets... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/dialogue_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
import json
from PIL import Image
from PIL import ImageFile
ImageFile.LOAD_TRUNCATED_I... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/coco_caption_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
from collections import OrderedDict
import json
import os
import torch
from PIL import Image
fro... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/aok_vqa_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
from collections import OrderedDict
from lavis.datasets.datasets.multimodal_classificat... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/snli_ve_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import torch
from lavis.datasets.datasets.base_dataset import BaseDataset
class VQADataset(Base... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/vqa_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
import json
from PIL import Image
from lavis.datasets.datasets.vqa_datasets import VQA... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/coco_vqa_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
import json
from PIL import Image
from lavis.datasets.datasets.vqa_datasets import VQA... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/gqa_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import torch
from lavis.datasets.datasets.dialogue_datasets import (
DialogueDataset,
Dial... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/avsd_dialogue_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
from collections import OrderedDict
from lavis.datasets.datasets.base_dataset import Ba... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/caption_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import os
from collections import OrderedDict
from lavis.datasets.datasets.base_dataset import Ba... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/datasets/datasets/retrieval_datasets.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
Based on huggingface code base
https://github.com/huggingface/transformers/blob/v4.15.0/src/transfo... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/models/med.py |
# Based on EVA, BEIT, timm and DeiT code bases
# https://github.com/baaivision/EVA
# https://github.com/rwightman/pytorch-image-models/tree/master/timm
# https://github.com/microsoft/unilm/tree/master/beit
# https://github.com/facebookresearch/deit/
# https://github.com/facebookresearch/dino
# -------------------------... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/models/eva_vit.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import logging
from omegaconf import OmegaConf
from lavis.common.registry import registry
from la... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/models/__init__.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import logging
import os
import numpy as np
import torch
import torch.nn as nn
from lavis.common.... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/models/base_model.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
Based on timm code base
https://github.com/rwightman/pytorch-image-models/tree/master/timm
"""
imp... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/models/vit.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import torch
import torch.nn as nn
from itertools import chain
from lavis.common.registry import r... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/models/pnp_vqa_models/pnp_vqa.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
"""
import torch
def prepare_qa_input(sample, num_captions, num_captions_fid):
sample_question_c... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/models/pnp_vqa_models/__init__.py |
"""
Copyright (c) 2022, salesforce.com, inc.
All rights reserved.
SPDX-License-Identifier: BSD-3-Clause
For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
Based on facebookresearch code base
https://github.com/facebookresearch/FiD
"""
import torch
import... | 3D-LLM-main | three_steps_3d_feature/second_step/lavis/models/pnp_vqa_models/pnp_unifiedqav2_fid.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.