python_code stringlengths 0 679k | repo_name stringlengths 9 41 | file_path stringlengths 6 149 |
|---|---|---|
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/__init__.py |
"""makenet docker entrypoint."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from maglev_sdk.docker_container.entrypoint import main
if __name__ == '__main__':
main('makenet', 'nvidia_tao_tf1/cv/makenet/scripts')
| tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/docker/makenet.py |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: nvidia_tao_tf1/cv/makenet/proto/optimizer_config.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from go... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/proto/optimizer_config_pb2.py |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: nvidia_tao_tf1/cv/makenet/proto/training_config.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from goo... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/proto/training_config_pb2.py |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: nvidia_tao_tf1/cv/makenet/proto/regularizer_config.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from ... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/proto/regularizer_config_pb2.py |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: nvidia_tao_tf1/cv/makenet/proto/lr_config.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.pr... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/proto/lr_config_pb2.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/proto/__init__.py |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: nvidia_tao_tf1/cv/makenet/proto/experiment.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.p... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/proto/experiment_pb2.py |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: nvidia_tao_tf1/cv/makenet/proto/eval_config.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/proto/eval_config_pb2.py |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: nvidia_tao_tf1/cv/makenet/proto/model_config.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/proto/model_config_pb2.py |
"""Utilities for ImageNet data preprocessing & prediction decoding."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
from keras import backend as K
import numpy as np
logger = logging.getLogger(__name__)
CLASS_INDEX = None
CLASS_INDEX_PATH... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/utils/preprocess_input.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/utils/__init__.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/utils/preprocess_crop.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/utils/mixup_generator.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/utils/callbacks.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/utils/helper.py |
"""Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
| tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/scripts/__init__.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/scripts/export.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/scripts/calibration_tensorfile.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/scripts/train.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/scripts/prune.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/scripts/inference.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/scripts/evaluate.py |
"""Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import keras
from keras.layers import BatchNormalization
import numpy as np
import pytest
from nvidia_tao_tf1.cv.makenet.model.model_bui... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/scripts/tests/test_freeze_bn.py |
# Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved.
"""TLT command line wrapper to invoke CLI scripts."""
import sys
from nvidia_tao_tf1.cv.common.entrypoint.entrypoint import launch_job
import nvidia_tao_tf1.cv.makenet.scripts
def main():
"""Function to launch the job."""
launch_job(nvidia_... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/entrypoint/makenet.py |
# Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved.
"""TLT MakeNet entrypoint."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
| tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/entrypoint/__init__.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/model/model_builder.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/model/__init__.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/spec_handling/constants.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/spec_handling/__init__.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/spec_handling/spec_loader.py |
# Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved.
"""Module containing sample spec files."""
| tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/experiment_specs/__init__.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/export/__init__.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/export/classification_calibrator.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | nvidia_tao_tf1/cv/makenet/export/classification_exporter.py |
tao_tensorflow1_backend-main | third_party/__init__.py | |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | third_party/keras/conftest.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | third_party/keras/mixed_precision.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | third_party/keras/test_tensorflow_backend.py |
tao_tensorflow1_backend-main | third_party/keras/__init__.py | |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | third_party/keras/tensorflow_backend.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | third_party/keras/test_mixed_precision.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | third_party/pybind11/py_bind_test.py |
"""Smoke tests for the built horovod wheel."""
import horovod
def test_built_horovod_version():
"""Test horovod available in ai-infra at the correct version."""
assert horovod.__version__ == "0.22.1"
def test_lazy_horovod_init():
"""Test horovod with tensorflow lazy initialization."""
import horovo... | tao_tensorflow1_backend-main | third_party/horovod/test_horovod.py |
import subprocess
import os
subprocess.call(
"{}/third_party/horovod/build_horovod.sh".format(os.getcwd()), shell=True
)
| tao_tensorflow1_backend-main | third_party/horovod/build_horovod.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | third_party/jsonnet/jsonnet.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | third_party/jsonnet/__init__.py |
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | tao_tensorflow1_backend-main | third_party/jsonnet/jsonnet_test.py |
#!/usr/bin/env python
# coding: utf-8
import json
import numpy as np
from PIL import Image
from tqdm import tqdm
# [ymin, ymax, xmin, xmax] to [x, y, w, h]
def box_transform(box):
x = box[2]
y = box[0]
w = box[3] - box[2] + 1
h = box[1] - box[0] + 1
return [x, y, w, h]
def convert_anno(spl... | ContrastiveLosses4VRD-master | tools/convert_vrd_anno_to_coco_format.py |
# Adapted by Ji Zhang, 2019
#
# Based on Detectron.pytorch/tools/test_net.py Written by Roy Tseng
"""Perform inference on one or more datasets."""
import argparse
import cv2
import os
import pprint
import sys
import time
from six.moves import cPickle as pickle
import torch
import _init_paths # pylint: disable=unus... | ContrastiveLosses4VRD-master | tools/test_net_rel.py |
# Based on Detectron.pytorch/tools/_init_paths.py by Roy Tseng
# modified for this project by Ji Zhang
"""Add {PROJECT_ROOT}/lib. to PYTHONPATH
Usage:
import this module before import any modules under lib/
e.g
import _init_paths
from core.config import cfg
"""
import os.path as osp
import sys
def add_pa... | ContrastiveLosses4VRD-master | tools/_init_paths.py |
#!/usr/bin/env python
# coding: utf-8
# In[23]:
import json
import numpy as np
import os
from PIL import Image
from tqdm import tqdm
import copy
from shutil import copyfile
# take the images from the sg_dataset folder and rename them
# Also converts the gif and png images into jpg
def process_vrd_split(in_split, ... | ContrastiveLosses4VRD-master | tools/rename_vrd_with_numbers.py |
# Adapted by Ji Zhang, 2019
#
# Based on Detectron.pytorch/tools/train_net.py Written by Roy Tseng
""" Training script for steps_with_decay policy"""
import argparse
import os
import sys
import pickle
import resource
import traceback
import logging
from collections import defaultdict
import numpy as np
import yaml
i... | ContrastiveLosses4VRD-master | tools/train_net_step_rel.py |
# Based on:
# Detectron.pytorch/lib/setup.py
# and modified for this project
# Original source license text:
# --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------... | ContrastiveLosses4VRD-master | lib/setup.py |
# Adapted by Ji Zhang, 2019
# from Detectron.pytorch/lib/core/test_engine.py
# Original license text below
# --------------------------------------------------------
# Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in com... | ContrastiveLosses4VRD-master | lib/core/test_engine_rel.py |
# Based on Detectron.pytorch/lib/core/config.py
# --------------------------------------------------------
# Detectron.pytorch
# Licensed under The MIT License [see LICENSE for details]
# Written by roytseng-tw
# --------------------------------------------------------
from __future__ import absolute_import
from __fut... | ContrastiveLosses4VRD-master | lib/core/config.py |
ContrastiveLosses4VRD-master | lib/core/__init__.py | |
# Adapted by Ji Zhang in 2019
# From Detectron.pytorch/lib/core/test.py
# Original license text below
# --------------------------------------------------------
# Written by Roy Tseng
#
# Based on:
# --------------------------------------------------------
# Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under... | ContrastiveLosses4VRD-master | lib/core/test_rel.py |
# Adapted from Detectron.pytorch/lib/modeling/fast_rcnn_heads.py
# for this project by Ji Zhang, 2019
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as init
from torch.autograd import Variable
from core.config import cfg
import nn as mynn
import utils.net as net_utils
class ... | ContrastiveLosses4VRD-master | lib/modeling_rel/fast_rcnn_heads.py |
"""
Some functions are adapted from Rowan Zellers:
https://github.com/rowanz/neural-motifs
"""
import os
import torch.nn as nn
import torch
from torch.autograd import Variable
import numpy as np
import logging
from six.moves import cPickle as pickle
from core.config import cfg
from modeling_rel.get_dataset_counts_rel ... | ContrastiveLosses4VRD-master | lib/modeling_rel/sparse_targets_rel.py |
# Written by Ji Zhang in 2019
import collections
import numpy as np
import logging
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn import init
from core.config import cfg
import utils.net as net_utils
import modeling.ResNet as ResNet
from modeling.generate_anchors import generate_anc... | ContrastiveLosses4VRD-master | lib/modeling_rel/rel_pyramid_module.py |
# Adapted from Detectron.pytorch/lib/modeling/generate_proposal_labels.py
# for this project by Ji Zhang, 2019
from torch import nn
from core.config import cfg
from datasets_rel import json_dataset_rel
from roi_data_rel.fast_rcnn_rel import add_rel_blobs
class GenerateRelProposalLabelsOp(nn.Module):
def __init_... | ContrastiveLosses4VRD-master | lib/modeling_rel/generate_rel_proposal_labels.py |
ContrastiveLosses4VRD-master | lib/modeling_rel/__init__.py | |
# Written by Ji Zhang in 2019
import numpy as np
from numpy import linalg as la
import json
import logging
from torch import nn
from torch.nn import init
import torch.nn.functional as F
from core.config import cfg
from modeling_rel.generate_rel_proposal_labels import GenerateRelProposalLabelsOp
import modeling.FPN a... | ContrastiveLosses4VRD-master | lib/modeling_rel/relpn_heads.py |
# Written by Ji Zhang in 2019
import os
import numpy as np
import logging
from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
from core.config import cfg
import nn as mynn
import torchvision.models as models
logger = logging.getLogger(__name__)
# ----------------... | ContrastiveLosses4VRD-master | lib/modeling_rel/VGG16.py |
# Written by Ji Zhang in 2019
import numpy as np
from numpy import linalg as la
import math
import logging
import json
import torch
from torch import nn
from torch.nn import init
import torch.nn.functional as F
from torch.autograd import Variable
import nn as mynn
from core.config import cfg
from modeling_rel.sparse... | ContrastiveLosses4VRD-master | lib/modeling_rel/reldn_heads.py |
# Adapted from Detectron.pytorch/lib/modeling/model_builder.py
# for this project by Ji Zhang, 2019
from functools import wraps
import importlib
import logging
import numpy as np
import copy
import json
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from core.c... | ContrastiveLosses4VRD-master | lib/modeling_rel/model_builder_rel.py |
# Some functions are adapted from Rowan Zellers:
# https://github.com/rowanz/neural-motifs
# Get counts of all of the examples in the dataset. Used for creating the baseline
# dictionary model
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ i... | ContrastiveLosses4VRD-master | lib/modeling_rel/get_dataset_counts_rel.py |
# Adapted by Ji Zhang in 2019
#
# Based on Detectron.pytorch/lib/roi_data/minibatch.py written by Roy Tseng
import numpy as np
import cv2
from core.config import cfg
import utils.blob as blob_utils
import roi_data.rpn
def get_minibatch_blob_names(is_training=True):
"""Return blob names in the order in which the... | ContrastiveLosses4VRD-master | lib/roi_data_rel/minibatch_rel.py |
# Adapted by Ji Zhang, 2019
#
# Based on Detectron.pytorch/lib/roi_data/fast_rcnn.py
# Original license text:
# --------------------------------------------------------
# Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in ... | ContrastiveLosses4VRD-master | lib/roi_data_rel/fast_rcnn_rel.py |
ContrastiveLosses4VRD-master | lib/roi_data_rel/__init__.py | |
# Adapted by Ji Zhang for this project in 2019
#
# Based on Detectron.Pytorch/lib/roi/loader.py by Roy Tseng
import math
import numpy as np
import numpy.random as npr
import torch
import torch.utils.data as data
import torch.utils.data.sampler as torch_sampler
from torch.utils.data.dataloader import default_collate
f... | ContrastiveLosses4VRD-master | lib/roi_data_rel/loader_rel.py |
# Adapted by Ji Zhang in 2019
#
# Based on Detectron.pytorch/lib/utils/net.py written by Roy Tseng
import logging
import os
import numpy as np
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from core.config import cfg
from utils.net import _get_lr_change_ratio
from utils.net import ... | ContrastiveLosses4VRD-master | lib/utils_rel/net_rel.py |
ContrastiveLosses4VRD-master | lib/utils_rel/__init__.py | |
# Adapted by Ji Zhang in 2019 for thsi project
# Based on Detectron.pytorch/lib/utils/training_stats.py
# Original license text below:
#
##############################################################################
# Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "Li... | ContrastiveLosses4VRD-master | lib/utils_rel/training_stats_rel.py |
# Adapted by Ji Zhang for this project in 2019
# Based on Detectron.pytorch/lib/utils/logging.py
# Original license text below:
#
############################################################################
# Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
... | ContrastiveLosses4VRD-master | lib/utils_rel/logging_rel.py |
# Adapted by Ji Zhang in 2019
# Based on Detectron.pytorch/lib/utils/subprocess.py
# Original license text below:
#
#############################################################################
#
# Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may n... | ContrastiveLosses4VRD-master | lib/utils_rel/subprocess_rel.py |
# Adapted by Ji Zhang in 2019 for this project
# Based on Detectron.pytorch/lib/utils/boxes.py
#
# Original license text below:
#
#############################################################################
# Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")... | ContrastiveLosses4VRD-master | lib/utils_rel/boxes_rel.py |
"""
Written by Ji Zhang, 2019
Some functions are adapted from Rowan Zellers
Original source:
https://github.com/rowanz/neural-motifs/blob/master/lib/evaluation/sg_eval.py
"""
import os
import numpy as np
import logging
from six.moves import cPickle as pickle
import json
import csv
from tqdm import tqdm
from core.confi... | ContrastiveLosses4VRD-master | lib/datasets_rel/task_evaluation_sg.py |
# Adapted from Detectron.pytorch/lib/datasets/roidb.py
# for this project by Ji Zhang, 2019
#
# --------------------------------------------------------
# Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with ... | ContrastiveLosses4VRD-master | lib/datasets_rel/roidb_rel.py |
"""
Written by Ji Zhang, 2019
Some functions are adapted from Rowan Zellers
Original source:
https://github.com/rowanz/neural-motifs/blob/master/lib/evaluation/sg_eval.py
"""
import os
import numpy as np
import logging
from six.moves import cPickle as pickle
import json
import csv
from tqdm import tqdm
from core.conf... | ContrastiveLosses4VRD-master | lib/datasets_rel/task_evaluation_vg_and_vrd.py |
ContrastiveLosses4VRD-master | lib/datasets_rel/__init__.py | |
# Adapted from Detectron.pytorch/lib/datasets/dataset_catalog.py
# for this project by Ji Zhang,2019
#-----------------------------------------------------------------------------
# Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file... | ContrastiveLosses4VRD-master | lib/datasets_rel/dataset_catalog_rel.py |
# Adapted from Detectron.pytorch/lib/datasets/voc_eval.py for
# this project by Ji Zhang, 2019
#-----------------------------------------------------------------------------
# Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file excep... | ContrastiveLosses4VRD-master | lib/datasets_rel/ap_eval_rel.py |
# This file is from https://github.com/rowanz/neural-motifs/blob/master/lib/pytorch_misc.py
# Unused imports and functions are deleted
"""
Miscellaneous functions that might be useful for pytorch
"""
import numpy as np
def intersect_2d(x1, x2):
"""
Given two arrays [m1, n], [m2,n], returns a [m1, m2] array... | ContrastiveLosses4VRD-master | lib/datasets_rel/pytorch_misc.py |
# Adapted from Detectron.pytorch/lib/datasets/json_dataset.py
# for this project by Ji Zhang, 2019
#-----------------------------------------------------------------------------
# Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file e... | ContrastiveLosses4VRD-master | lib/datasets_rel/json_dataset_rel.py |
#! /usr/bin/python3
import sys,os,json,requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
# Input file with read line by line
file = sys.argv[1]
f = open(file,'r')
lines = f.readlines()
# Itterate the each host to get the RedFish Details
for item in lines:
if item == '[master]\n' or... | cloud-native-stack-master | playbooks/files/redfish.py |
#!/usr/bin/env python3
import json
import requests
inFileName = "../../README.md"
outFileName = "../../docs/index.html"
htmlBeforeBody = '''
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-s... | NVTX-release-v3 | tools/docs/generate-readme.py |
# Copyright 2020-2022 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
import os
import glob
import sysconfig
from distutils.sysconfig import g... | NVTX-release-v3 | python/setup.py |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | NVTX-release-v3 | python/docs/conf.py |
# Copyright 2020-2022 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
from nvtx.nvtx import (
annotate,
enabled,
pop_range,
pu... | NVTX-release-v3 | python/nvtx/__init__.py |
# Copyright 2020-2022 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
import contextlib
import os
from functools import wraps
from nvtx._lib... | NVTX-release-v3 | python/nvtx/nvtx.py |
import sys
from runpy import run_path
from optparse import OptionParser
def main():
from nvtx import Profile
usage = "%prog [options] scriptfile [args] ..."
parser = OptionParser(usage)
parser.add_option(
"--linenos",
action="store_true",
dest="linenos",
default=True,
... | NVTX-release-v3 | python/nvtx/__main__.py |
# Copyright 2020-2022 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
import functools
_NVTX_COLORS = {
None: 0x0000FF, # blue
"gree... | NVTX-release-v3 | python/nvtx/colors.py |
# Copyright 2020-2022 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
import pickle
import pytest
import nvtx
@pytest.mark.parametrize(
... | NVTX-release-v3 | python/nvtx/tests/test_basic.py |
NVTX-release-v3 | python/nvtx/tests/test_profiler.py | |
# Copyright 2021-2022 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
import functools
import importlib
import sys
def py_func(func):
""... | NVTX-release-v3 | python/nvtx/tests/test_cython.py |
# Copyright 2020-2022 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
from nvtx._lib.lib import (
Domain,
EventAttributes,
pop_ran... | NVTX-release-v3 | python/nvtx/_lib/__init__.py |
NVTX-release-v3 | python/nvtx/_lib/tests/__init__.py | |
# Copyright 2020-2022 NVIDIA Corporation. All rights reserved.
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
| NVTX-release-v3 | python/nvtx/utils/__init__.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.