Skip to content

Instantly share code, notes, and snippets.

View tamnguyenvan's full-sized avatar

Tam Nguyen tamnguyenvan

  • Ha Noi Viet Nam
View GitHub Profile
import argparse
import time
import math
from pathlib import Path
import cv2
import torch
import torch.backends.cudnn as cudnn
from numpy import random
import numpy as np
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
ROOT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
import numpy as np
import json
import torch
set nocompatible
filetype off
call plug#begin()
Plug 'preservim/nerdtree'
Plug 'kien/ctrlp.vim'
Plug 'tpope/vim-commentary'
import numpy as np
import logging
import pathlib
import xml.etree.ElementTree as ET
import cv2
import os
class VOCDataset:
"""
Copyright (C) 2018-2019 Intel Corporation
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 applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
"""
Copyright (C) 2018-2019 Intel Corporation
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 applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
import argparse
import math
from copy import deepcopy
from pathlib import Path
import torch
import torch.nn as nn
from models.common import *
from models.experimental import MixConv2d, CrossConv, C3
import argparse
import math
from copy import deepcopy
from pathlib import Path
import torch
import torch.nn as nn
from models.common import *
from models.experimental import MixConv2d, CrossConv, C3
from pyfaust.fact import palm4msa
from pyfaust.factparams import ParamsPalm4MSA, ConstraintList, StoppingCriterion
import numpy as np
# M = np.random.rand(500, 32)
# M = np.arange(500*32).reshape((500, 32)).astype('float64')
M = np.arange(100).reshape((10, 10)).astype('float64')
print(M)
# cons = ConstraintList('splin', 5, 500, 32, 'normcol', 1.0, 32, 32)
cons = ConstraintList('sp', 20, 10, 10, 'sp', 20, 10, 10)
"""trt_yolo.py
This script demonstrates how to do real-time object detection with
TensorRT optimized YOLO engine.
"""
import os
import time
import argparse