text stringlengths 24 1.04M | metadata stringlengths 233 497 |
|---|---|
### File: sorting/wave_sort.cpp
/**
* @file
* @brief Implementation of the [Wave
* sort](https://www.geeksforgeeks.org/sort-array-wave-form-2/) algorithm
* @details
* Wave Sort is a sorting algorithm that works in \f$O(nlogn)\f$ time assuming
* the sort function used works in \f$O(nlogn)\f$ time.
* @author [Swas... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/TheAlgorithms-c-plus-plus", "path": "sorting/wave_sort.cpp", "license": "mit", "size": 2919} |
### File: sorting/wiggle_sort.cpp
/**
* \addtogroup sorting Sorting Algorithms
* @{
* \file
* \brief [Wiggle Sort Algorithm]
* (https://leetcode.com/problems/wiggle-sort-ii/) Implementation
*
* \author [Roshan Kanwar](http://github.com/roshan0708)
*
* \details
* Wiggle Sort sorts the array into a wave like ar... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/TheAlgorithms-c-plus-plus", "path": "sorting/wiggle_sort.cpp", "license": "mit", "size": 3479} |
### File: strings/CMakeLists.txt
# If necessary, use the RELATIVE flag, otherwise each source file may be listed
# with full pathname. RELATIVE may makes it easier to extract an executable name
# automatically.
file( GLOB APP_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp )
# file( GLOB APP_SOURCES ${CMAKE_SOURCE_D... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/TheAlgorithms-c-plus-plus", "path": "strings/CMakeLists.txt", "license": "mit", "size": 842} |
### File: strings/boyer_moore.cpp
/**
* @file
* @brief
* The
* [Boyer–Moore](https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string-search_algorithm)
* algorithm searches for occurrences of pattern P in text T by performing
* explicit character comparisons at different alignments. Instead of a
* brute-force se... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/TheAlgorithms-c-plus-plus", "path": "strings/boyer_moore.cpp", "license": "mit", "size": 8630} |
### File: strings/brute_force_string_searching.cpp
/**
* @file
* @brief String pattern search - brute force
*/
#include <iostream>
#ifdef _MSC_VER
#include <string> // use this for MS Visual C++
#else
#include <cstring>
#endif
#include <vector>
namespace string_search {
/**
* Find a pattern in a string b... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/TheAlgorithms-c-plus-plus", "path": "strings/brute_force_string_searching.cpp", "license": "mit", "size": 1577} |
### File: strings/duval.cpp
/**
* @file duval.cpp
* @brief Implementation of [Duval's algorithm](https://en.wikipedia.org/wiki/Lyndon_word).
*
* @details
* Duval's algorithm is an algorithm to find the lexicographically smallest
* rotation of a string. It is based on the concept of Lyndon words.
* Lyndon words a... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/TheAlgorithms-c-plus-plus", "path": "strings/duval.cpp", "license": "mit", "size": 3328} |
### File: strings/horspool.cpp
/**
* @file
* @brief Horspool's algorithm that finds if a string contains a substring (https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore%E2%80%93Horspool_algorithm)
* @author [Harry Kontakis](https://github.com/ckontakis)
*/
#include <iostream>
#include <unordered_map>
#include <cass... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/TheAlgorithms-c-plus-plus", "path": "strings/horspool.cpp", "license": "mit", "size": 4775} |
### File: strings/knuth_morris_pratt.cpp
/**
* @file
* @brief The [Knuth-Morris-Pratt
* Algorithm](https://en.wikipedia.org/wiki/Knuth–Morris–Pratt_algorithm) for
* finding a pattern within a piece of text with complexity O(n + m)
* @details
* 1. Preprocess pattern to identify any suffixes that are identical to
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/TheAlgorithms-c-plus-plus", "path": "strings/knuth_morris_pratt.cpp", "license": "mit", "size": 3000} |
### File: strings/manacher_algorithm.cpp
/**
* @file
* @brief Implementation of [Manacher's
* Algorithm](https://en.wikipedia.org/wiki/Longest_palindromic_substring)
* @details
* Manacher's Algorithm is used to find the longest palindromic substring within
* a string in O(n) time. It exploits the property of a pa... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/TheAlgorithms-c-plus-plus", "path": "strings/manacher_algorithm.cpp", "license": "mit", "size": 6887} |
### File: strings/rabin_karp.cpp
/**
* \file
* \brief The [Rabin-Karp
* Algorithm](https://en.wikipedia.org/wiki/Rabin–Karp_algorithm) for finding a
* pattern within a piece of text with complexity O(n + m)
*/
#include <cassert>
#include <cmath>
#include <iostream>
#ifdef _MSC_VER
#include <string> // use this fo... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/TheAlgorithms-c-plus-plus", "path": "strings/rabin_karp.cpp", "license": "mit", "size": 3427} |
### File: strings/z_function.cpp
/**
* @file
* @brief The [Z function](https://cp-algorithms.com/string/z-function.html) for
* finding occurences of a pattern within a piece of text with time and space
* complexity O(n + m)
* @details
* 1. The Z-function for a string is an array of length n where the
* i-th elem... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/TheAlgorithms-c-plus-plus", "path": "strings/z_function.cpp", "license": "mit", "size": 3793} |
### File: CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(uncrustify_vendor)
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_vendor_package REQUIRED)
function(check_uncrustify RESULT PROGRAM)
execute_process(
COMMAND ${PROGRAM} --version
RESULT_VARIABLE res
OUTPUT_VARIABLE out
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/uncrustify_vendor", "path": "CMakeLists.txt", "license": "apache-2.0", "size": 1117} |
### File: WORKSPACE
workspace(name = "com_github_cncf_udpa")
load("//bazel:repositories.bzl", "udpa_api_dependencies")
udpa_api_dependencies()
load("//bazel:dependency_imports.bzl", "udpa_dependency_imports")
udpa_dependency_imports()
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/udpa", "path": "WORKSPACE", "license": "apache-2.0", "size": 219} |
### File: bazel/BUILD
load("@io_bazel_rules_go//proto:compiler.bzl", "go_proto_compiler")
licenses(["notice"]) # Apache 2
go_proto_compiler(
name = "pgv_plugin_go",
options = ["lang=go"],
plugin = "@com_envoyproxy_protoc_gen_validate//:protoc-gen-validate",
suffix = ".pb.validate.go",
valid_archi... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/udpa", "path": "bazel/BUILD", "license": "apache-2.0", "size": 354} |
### File: bazel/api_build_system.bzl
load("@com_envoyproxy_protoc_gen_validate//bazel:pgv_proto_library.bzl", "pgv_cc_proto_library")
load("@com_google_protobuf//:protobuf.bzl", _py_proto_library = "py_proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_test")
load("@io_bazel_rules_go//proto:def.bzl", "go_grpc_l... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/udpa", "path": "bazel/api_build_system.bzl", "license": "apache-2.0", "size": 6270} |
### File: bazel/dependency_imports.bzl
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language")
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@rules_foreign_cc//:works... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/udpa", "path": "bazel/dependency_imports.bzl", "license": "apache-2.0", "size": 1511} |
### File: bazel/envoy_http_archive.bzl
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def udpa_http_archive(name, locations, **kwargs):
# `existing_rule_keys` contains the names of repositories that have already
# been defined in the Bazel workspace. By skipping repos with existing keys,
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/udpa", "path": "bazel/envoy_http_archive.bzl", "license": "apache-2.0", "size": 976} |
### File: bazel/foreign_cc/BUILD
load("@rules_foreign_cc//tools/build_defs:cmake.bzl", "cmake_external")
cmake_external(
name = "zlib",
cache_entries = {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
},
lib_source = "@net_zlib//:all",
static_libraries = select({
"//conditions:default": ["li... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/udpa", "path": "bazel/foreign_cc/BUILD", "license": "apache-2.0", "size": 347} |
### File: bazel/repositories.bzl
load(":envoy_http_archive.bzl", "udpa_http_archive")
load(":repository_locations.bzl", "REPOSITORY_LOCATIONS")
# Make all contents of an external repository accessible under a filegroup. Used for external HTTP
# archives, e.g. cares.
BUILD_ALL_CONTENT = """filegroup(name = "all", srcs... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/udpa", "path": "bazel/repositories.bzl", "license": "apache-2.0", "size": 2120} |
### File: bazel/repository_locations.bzl
REPOSITORY_LOCATIONS = dict(
bazel_gazelle = dict(
sha256 = "be9296bfd64882e3c08e3283c58fcb461fa6dd3c171764fcc4cf322f60615a9b",
urls = ["https://github.com/bazelbuild/bazel-gazelle/releases/download/0.18.1/bazel-gazelle-0.18.1.tar.gz"],
),
bazel_skyli... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/udpa", "path": "bazel/repository_locations.bzl", "license": "apache-2.0", "size": 3284} |
### File: ci/check.sh
#!/usr/bin/env bash
set -e
bazel test --config=ci //...
rm -rf go/udpa
tools/generate_go_protobuf.py
git add go/udpa
echo "If this check fails, apply following diff:"
git diff HEAD
git diff HEAD --quiet
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Shell", "repo_name": "minhanghuang/udpa", "path": "ci/check.sh", "license": "apache-2.0", "size": 209} |
### File: repokitteh.star
use("github.com/repokitteh/modules/wait.star")
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/udpa", "path": "repokitteh.star", "license": "apache-2.0", "size": 47} |
### File: tools/generate_go_protobuf.py
#!/usr/bin/env python3
from subprocess import check_output
import glob
import os
import shutil
def generateProtobufs(output):
bazel_bin = check_output(['bazel', 'info', 'bazel-bin']).decode().strip()
go_protos = check_output([
'bazel',
'query',
'kind("go_... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/udpa", "path": "tools/generate_go_protobuf.py", "license": "apache-2.0", "size": 1126} |
### File: udpa/annotations/BUILD
load("//bazel:api_build_system.bzl", "udpa_proto_package")
licenses(["notice"]) # Apache 2
udpa_proto_package()
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/udpa", "path": "udpa/annotations/BUILD", "license": "apache-2.0", "size": 115} |
### File: udpa/data/orca/v1/BUILD
load("//bazel:api_build_system.bzl", "udpa_proto_package")
licenses(["notice"]) # Apache 2
udpa_proto_package()
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/udpa", "path": "udpa/data/orca/v1/BUILD", "license": "apache-2.0", "size": 115} |
### File: udpa/service/orca/v1/BUILD
load("//bazel:api_build_system.bzl", "udpa_proto_package")
licenses(["notice"]) # Apache 2
udpa_proto_package(
has_services = True,
deps = [
"//udpa/data/orca/v1:pkg",
],
)
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/udpa", "path": "udpa/service/orca/v1/BUILD", "license": "apache-2.0", "size": 196} |
### File: udpa/type/v1/BUILD
load("//bazel:api_build_system.bzl", "udpa_proto_package")
licenses(["notice"]) # Apache 2
udpa_proto_package()
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/udpa", "path": "udpa/type/v1/BUILD", "license": "apache-2.0", "size": 115} |
### File: xds/core/v3/BUILD
load("//bazel:api_build_system.bzl", "udpa_proto_package")
licenses(["notice"]) # Apache 2
udpa_proto_package(deps = ["//udpa/annotations:pkg"])
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Starlark", "repo_name": "minhanghuang/udpa", "path": "xds/core/v3/BUILD", "license": "apache-2.0", "size": 148} |
### File: CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(unique_identifier_msgs)
# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
# we dont use add_compile_options... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/unique_identifier_msgs", "path": "CMakeLists.txt", "license": "bsd-3-clause", "size": 994} |
### File: msg/UUID.msg
# A universally unique identifier (UUID).
#
# http://en.wikipedia.org/wiki/Universally_unique_identifier
# http://tools.ietf.org/html/rfc4122.html
uint8[16] uuid
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "omnetpp-msg", "repo_name": "minhanghuang/unique_identifier_msgs", "path": "msg/UUID.msg", "license": "bsd-3-clause", "size": 165} |
### File: CMakeLists.txt
cmake_minimum_required(VERSION 3.5)
project(tango_icons_vendor)
find_package(ament_cmake REQUIRED)
if(WIN32 OR APPLE)
set(INSTALL_TANGO_ICONS_DEFAULT_VALUE TRUE)
else()
set(INSTALL_TANGO_ICONS_DEFAULT_VALUE FALSE)
endif()
option(INSTALL_TANGO_ICONS "Install Tango icons" ${INSTALL_TANGO_IC... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/tango_icons_vendor", "path": "CMakeLists.txt", "license": "apache-2.0", "size": 544} |
### File: alexnet/CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(alexnet)
add_definitions(-std=c++11)
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)
include_directories(${PROJECT_SOURCE_DIR}/include)
# include and link dirs of cuda and tensorrt, you need ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/tensorrtx", "path": "alexnet/CMakeLists.txt", "license": "mit", "size": 686} |
### File: alexnet/alex.cpp
#include "NvInfer.h"
#include "cuda_runtime_api.h"
#include "logging.h"
#include <fstream>
#include <map>
#include <chrono>
#define CHECK(status) \
do\
{\
auto ret = (status);\
if (ret != 0)\
{\
std::cerr << "Cuda failure: " << ret << std::endl;\
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "alexnet/alex.cpp", "license": "mit", "size": 10748} |
### File: alexnet/alexnet.py
import os
import sys
import struct
import argparse
import numpy as np
import pycuda.autoinit
import pycuda.driver as cuda
import tensorrt as trt
BATCH_SIZE = 1
INPUT_H = 224
INPUT_W = 224
OUTPUT_SIZE = 1000
INPUT_BLOB_NAME = "data"
OUTPUT_BLOB_NAME = "prob"
WEIGHT_PATH = "./alexnet.wts"
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/tensorrtx", "path": "alexnet/alexnet.py", "license": "mit", "size": 8916} |
### File: alexnet/logging.h
/*
* Copyright (c) 2019, 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/LIC... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "alexnet/logging.h", "license": "mit", "size": 16550} |
### File: arcface/CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(arcface)
add_definitions(-std=c++11)
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)
find_package(CUDA REQUIRED)
include_directories(${PROJECT_SOURCE_DIR}/include)
if (CMAKE_SYSTEM_PROCESSOR... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/tensorrtx", "path": "arcface/CMakeLists.txt", "license": "mit", "size": 1699} |
### File: arcface/arcface-mobilefacenet.cpp
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
#include <vector>
#include <chrono>
#include <opencv2/opencv.hpp>
#include <dirent.h>
#include "NvInfer.h"
#include "cuda_runtime_api.h"
#include "logging.h"
#define CHECK(status) \
do\... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "arcface/arcface-mobilefacenet.cpp", "license": "mit", "size": 19223} |
### File: arcface/arcface-r100.cpp
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
#include <vector>
#include <chrono>
#include <opencv2/opencv.hpp>
#include <dirent.h>
#include "NvInfer.h"
#include "cuda_runtime_api.h"
#include "logging.h"
#define CHECK(status) \
do\
{\
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "arcface/arcface-r100.cpp", "license": "mit", "size": 20447} |
### File: arcface/arcface-r50.cpp
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
#include <vector>
#include <chrono>
#include <opencv2/opencv.hpp>
#include <dirent.h>
#include "NvInfer.h"
#include "cuda_runtime_api.h"
#include "logging.h"
#define CHECK(status) \
do\
{\
auto re... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "arcface/arcface-r50.cpp", "license": "mit", "size": 17544} |
### File: arcface/gen_wts.py
import struct
import sys
import argparse
import face_model
import cv2
import numpy as np
parser = argparse.ArgumentParser(description='face model test')
# general
parser.add_argument('--image-size', default='112,112', help='')
parser.add_argument('--model', default='model-r100-ii/model,0',... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/tensorrtx", "path": "arcface/gen_wts.py", "license": "mit", "size": 1416} |
### File: arcface/logging.h
/*
* Copyright (c) 2019, 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/LIC... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "arcface/logging.h", "license": "mit", "size": 16675} |
### File: arcface/macros.h
#ifndef __MACROS_H
#define __MACROS_H
#if NV_TENSORRT_MAJOR >= 8
#define TRT_NOEXCEPT noexcept
#define TRT_CONST_ENQUEUE const
#else
#define TRT_NOEXCEPT
#define TRT_CONST_ENQUEUE
#endif
#endif // __MACROS_H | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/tensorrtx", "path": "arcface/macros.h", "license": "mit", "size": 210} |
### File: arcface/prelu.cu
#include <cmath>
#include <stdio.h>
#include <cassert>
#include <iostream>
#include "prelu.h"
namespace nvinfer1
{
PReluPlugin::PReluPlugin(const std::vector<float>& gamma) : gamma_(gamma)
{
}
PReluPlugin::~PReluPlugin()
{
}
// create the plugin at runtime from ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Cuda", "repo_name": "minhanghuang/tensorrtx", "path": "arcface/prelu.cu", "license": "mit", "size": 6996} |
### File: arcface/prelu.h
#ifndef _PRELU_PLUGIN_H
#define _PRELU_PLUGIN_H
#include <string>
#include <vector>
#include "NvInfer.h"
#include "macros.h"
namespace nvinfer1
{
class PReluPlugin: public IPluginV2IOExt
{
public:
PReluPlugin(const std::vector<float>& gamma);
PReluPlug... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "arcface/prelu.h", "license": "mit", "size": 3954} |
### File: centernet/centernet.py
import numpy as np
import tensorrt as trt
import torch
from sample import common
import argparse
import time
# You can set the logger severity higher to suppress messages (or lower to display more messages).
TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
trt.init_libnvinfer_plugins(TRT... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/tensorrtx", "path": "centernet/centernet.py", "license": "mit", "size": 16029} |
### File: centernet/dcnv2Plugin/CMakeLists.txt
#
# Copyright (c) 2020, 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/l... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/tensorrtx", "path": "centernet/dcnv2Plugin/CMakeLists.txt", "license": "mit", "size": 867} |
### File: centernet/dcnv2Plugin/dcn_v2_im2col_cuda.cu
#include "dcn_v2_im2col_cuda.h"
#include <cstdio>
#include <algorithm>
#include <cstring>
#define CUDA_KERNEL_LOOP(i, n) \
for (int i = blockIdx.x * blockDim.x + threadIdx.x; \
i < (n); \
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Cuda", "repo_name": "minhanghuang/tensorrtx", "path": "centernet/dcnv2Plugin/dcn_v2_im2col_cuda.cu", "license": "mit", "size": 19792} |
### File: centernet/dcnv2Plugin/dcn_v2_im2col_cuda.h
/*!
******************* BEGIN Caffe Copyright Notice and Disclaimer ****************
*
* COPYRIGHT
*
* All contributions by the University of California:
* Copyright (c) 2014-2017 The Regents of the University of California (Regents)
* All rights reserved.
*
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C", "repo_name": "minhanghuang/tensorrtx", "path": "centernet/dcnv2Plugin/dcn_v2_im2col_cuda.h", "license": "mit", "size": 5246} |
### File: centernet/dcnv2Plugin/dcnv2Plugin.cpp
#include "dcnv2Plugin.h"
#include <iostream>
using namespace nvinfer1;
using nvinfer1::plugin::DeformableConvolutionalLayer;
using nvinfer1::plugin::DCNv2PluginCreator;
namespace
{
const char* DCNv2_PLUGIN_VERSION{"1"};
const char* DCNv2_PLUGIN_NAME{"DCNv2_TRT"};
} // n... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "centernet/dcnv2Plugin/dcnv2Plugin.cpp", "license": "mit", "size": 14744} |
### File: centernet/dcnv2Plugin/dcnv2Plugin.h
/*
* Copyright (c) 2020, 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.apach... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "centernet/dcnv2Plugin/dcnv2Plugin.h", "license": "mit", "size": 4439} |
### File: centernet/sample/common.py
#
# Copyright 1993-2020 NVIDIA Corporation. All rights reserved.
#
# NOTICE TO LICENSEE:
#
# This source code and/or documentation ("Licensed Deliverables") are
# subject to NVIDIA intellectual property rights under U.S. and
# international Copyright laws.
#
# These Licensed Delive... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/tensorrtx", "path": "centernet/sample/common.py", "license": "mit", "size": 9637} |
### File: centernet/sample/test.py
import cv2 as cv
import numpy as np
import tensorrt as trt
import common
import torch
import time
from sys import argv
# You can set the logger severity higher to suppress messages (or lower to display more messages).
TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
trt.init_libnvinfer_... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/tensorrtx", "path": "centernet/sample/test.py", "license": "mit", "size": 4660} |
### File: crnn/CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(crnn)
add_definitions(-std=c++11)
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)
find_package(CUDA REQUIRED)
include_directories(${PROJECT_SOURCE_DIR}/include)
if (CMAKE_SYSTEM_PROCESSOR MATCH... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/tensorrtx", "path": "crnn/CMakeLists.txt", "license": "mit", "size": 879} |
### File: crnn/crnn.cpp
#include <iostream>
#include <chrono>
#include <map>
#include <opencv2/opencv.hpp>
#include "NvInfer.h"
#include "cuda_runtime_api.h"
#include "logging.h"
#define CHECK(status) \
do\
{\
auto ret = (status);\
if (ret != 0)\
{\
std::cerr <... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "crnn/crnn.cpp", "license": "mit", "size": 18418} |
### File: crnn/genwts.py
import torch
from torch.autograd import Variable
import utils
import models.crnn as crnn
import struct
model_path = './data/crnn.pth'
model = crnn.CRNN(32, 1, 37, 256)
if torch.cuda.is_available():
model = model.cuda()
print('loading pretrained model from %s' % model_path)
model.load_stat... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/tensorrtx", "path": "crnn/genwts.py", "license": "mit", "size": 859} |
### File: crnn/logging.h
/*
* Copyright (c) 2019, 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/LICENS... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "crnn/logging.h", "license": "mit", "size": 16550} |
### File: dbnet/CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(dbnet)
add_definitions(-std=c++11)
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)
find_package(CUDA REQUIRED)
include_directories(${PROJECT_SOURCE_DIR}/include)
# cuda
include_directories(/u... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/tensorrtx", "path": "dbnet/CMakeLists.txt", "license": "mit", "size": 850} |
### File: dbnet/clipper/CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
aux_source_directory(. DIR_CLIPPER_SRCS)
add_library(clipper ${DIR_CLIPPER_SRCS}) | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/tensorrtx", "path": "dbnet/clipper/CMakeLists.txt", "license": "mit", "size": 118} |
### File: dbnet/clipper/clipper.cpp
/*******************************************************************************
* *
* Author : Angus Johnson *
* Version : 6.4.2 ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "dbnet/clipper/clipper.cpp", "license": "mit", "size": 137615} |
### File: dbnet/clipper/clipper.hpp
/*******************************************************************************
* *
* Author : Angus Johnson *
* Version : 6.4.2 ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "dbnet/clipper/clipper.hpp", "license": "mit", "size": 15017} |
### File: dbnet/common.hpp
#ifndef DBNET_COMMON_H_
#define DBNET_COMMON_H_
#include <iostream>
#include <fstream>
#include <map>
#include <sstream>
#include <vector>
#include <opencv2/opencv.hpp>
#include "dirent.h"
#include "NvInfer.h"
#include <chrono>
#define CHECK(status) \
do\
{\
auto ret = (stat... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "dbnet/common.hpp", "license": "mit", "size": 6458} |
### File: dbnet/dbnet.cpp
#include <iostream>
#include <chrono>
#include "cuda_runtime_api.h"
#include "logging.h"
#include "common.hpp"
#include <math.h>
#include "clipper.hpp"
#define USE_FP16 // comment out this if want to use FP32
#define DEVICE 0 // GPU id
#define EXPANDRATIO 1.5
#define BOX_MINI_SIZE 5
#define... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "dbnet/dbnet.cpp", "license": "mit", "size": 23657} |
### File: dbnet/logging.h
/*
* Copyright (c) 2019, 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/LICEN... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "dbnet/logging.h", "license": "mit", "size": 16550} |
### File: dbnet/utils.h
#ifndef __TRT_UTILS_H_
#define __TRT_UTILS_H_
#include <iostream>
#include <vector>
#include <algorithm>
#include <cudnn.h>
#ifndef CUDA_CHECK
#define CUDA_CHECK(callstr) \
{ ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "dbnet/utils.h", "license": "mit", "size": 3146} |
### File: densenet/CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
# set the project name
project(densenet)
add_definitions(-std=c++11)
# get main project dir to include common files
get_filename_component(MAIN_DIR ../ ABSOLUTE)
# When enabled the static version of the
# CUDA runtime library will be used in CU... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/tensorrtx", "path": "densenet/CMakeLists.txt", "license": "mit", "size": 901} |
### File: densenet/densenet121.cpp
#include "NvInfer.h"
#include "cuda_runtime_api.h"
#include "logging.h"
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
#include <vector>
#include <chrono>
#include <cmath>
#define CHECK(status) \
do\
{\
auto ret = (status);\
if (ret !... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "densenet/densenet121.cpp", "license": "mit", "size": 14504} |
### File: densenet/densenet121.py
import os
import sys
import struct
import argparse
import numpy as np
import pycuda.autoinit
import pycuda.driver as cuda
import tensorrt as trt
BATCH_SIZE = 1
INPUT_H = 224
INPUT_W = 224
OUTPUT_SIZE = 1000
INPUT_BLOB_NAME = "data"
OUTPUT_BLOB_NAME = "prob"
EPS = 1e-5
WEIGHT_PATH =... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/tensorrtx", "path": "densenet/densenet121.py", "license": "mit", "size": 10194} |
### File: densenet/logging.h
/*
* Copyright (c) 2021, 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/LI... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "densenet/logging.h", "license": "mit", "size": 16650} |
### File: detr/CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(detr)
add_definitions(-std=c++11)
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)
find_package(CUDA REQUIRED)
include_directories(${PROJECT_SOURCE_DIR}/include)
# include and link dirs of cuda ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/tensorrtx", "path": "detr/CMakeLists.txt", "license": "mit", "size": 943} |
### File: detr/backbone.hpp
#pragma once
#include <map>
#include "common.hpp"
enum RESNETTYPE {
R18 = 0,
R34,
R50,
R101,
R152
};
const std::map<RESNETTYPE, std::vector<int>> num_blocks_per_stage = {
{R18, {2, 2, 2, 2}},
{R34, {3, 4, 6, 3}},
{R50, {3, 4, 6, 3}},
{R101, {3, 4, 23, 3}... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "detr/backbone.hpp", "license": "mit", "size": 9704} |
### File: detr/calibrator.hpp
#pragma once
#include "NvInfer.h"
#include <string>
#include <vector>
#include <iostream>
#include <iterator>
#include <fstream>
#include <algorithm>
#include "common.hpp"
//! \class Int8EntropyCalibrator2
//!
//! \brief Implements Entropy calibrator 2.
//! CalibrationAlgoType is kENTRO... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "detr/calibrator.hpp", "license": "mit", "size": 4029} |
### File: detr/common.hpp
#pragma once
#include <dirent.h>
#include <cuda_runtime_api.h>
#include <fstream>
#include <sstream>
#include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
#include "./logging.h"
#include <NvInfer.h>
#include <opencv2/opencv.hpp>
static Logger gLogger;
using nam... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "detr/common.hpp", "license": "mit", "size": 2723} |
### File: detr/detr.cpp
#pragma once
#include <iostream>
#include <unordered_map>
#include "./logging.h"
#include "backbone.hpp"
#include "calibrator.hpp"
#define DEVICE 0
#define BATCH_SIZE 1
// 1 / math.sqrt(head_dim) https://github.com/pytorch/pytorch/blob/master/torch/csrc/api/include/torch/nn/functional/activati... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "detr/detr.cpp", "license": "mit", "size": 27591} |
### File: detr/gen_wts.py
import cv2
import torch
from models.transformer import Transformer
from models.position_encoding import PositionEmbeddingSine
from models.backbone import Backbone, Joiner
from models.detr import DETR
import torchvision.transforms as T
from PIL import Image
import struct
def box_cxcywh_to_xyx... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/tensorrtx", "path": "detr/gen_wts.py", "license": "mit", "size": 3935} |
### File: detr/logging.h
/*
* Copyright (c) 2019, 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/LICENS... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "detr/logging.h", "license": "mit", "size": 16351} |
### File: docker/trt7/Dockerfile
ARG TENSORRT="7"
ARG CUDA="10"
FROM hakuyyf/tensorrtx:trt${TENSORRT}_cuda${CUDA}
# Get opencv 3.4 for bionic based images
RUN rm /etc/apt/sources.list.d/timsc-ubuntu-opencv-3_3-bionic.list
RUN rm /etc/apt/sources.list.d/timsc-ubuntu-opencv-3_3-bionic.list.save
RUN add-apt-repository -... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Dockerfile", "repo_name": "minhanghuang/tensorrtx", "path": "docker/trt7/Dockerfile", "license": "mit", "size": 488} |
### File: docker/trt8/Dockerfile
ARG TENSORRT="8"
ARG CUDA="11"
FROM hakuyyf/tensorrtx:trt${TENSORRT}_cuda${CUDA}
| {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Dockerfile", "repo_name": "minhanghuang/tensorrtx", "path": "docker/trt8/Dockerfile", "license": "mit", "size": 82} |
### File: efficientnet/CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(efficientnet)
add_definitions(-std=c++11)
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)
find_package(CUDA REQUIRED)
include_directories(${PROJECT_SOURCE_DIR}/include)
# include and li... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/tensorrtx", "path": "efficientnet/CMakeLists.txt", "license": "mit", "size": 744} |
### File: efficientnet/efficientnet.cpp
#include "NvInfer.h"
#include "cuda_runtime_api.h"
#include "logging.h"
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
#include <vector>
#include <chrono>
#include "utils.hpp"
#define USE_FP32 //USE_FP16
#define INPUT_NAME "data"
#define OUTPUT_NAME "pr... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "efficientnet/efficientnet.cpp", "license": "mit", "size": 10039} |
### File: efficientnet/gen_wts.py
import torch
import struct
from efficientnet_pytorch import EfficientNet
model = EfficientNet.from_pretrained('efficientnet-b3')
model.eval()
f = open('efficientnet-b3.wts', 'w')
f.write('{}\n'.format(len(model.state_dict().keys())))
for k, v in model.state_dict().items():
vr = v.... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/tensorrtx", "path": "efficientnet/gen_wts.py", "license": "mit", "size": 471} |
### File: efficientnet/logging.h
/*
* Copyright (c) 2019, 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/license... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "efficientnet/logging.h", "license": "mit", "size": 16550} |
### File: efficientnet/utils.hpp
#include "NvInfer.h"
#include "cuda_runtime_api.h"
#include "logging.h"
#include <math.h>
#include <string>
#include <algorithm>
using namespace nvinfer1;
#define CHECK(status) \
do \
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "efficientnet/utils.hpp", "license": "mit", "size": 9439} |
### File: googlenet/CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(googlenet)
add_definitions(-std=c++11)
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)
include_directories(${PROJECT_SOURCE_DIR}/include)
# include and link dirs of cuda and tensorrt, you n... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/tensorrtx", "path": "googlenet/CMakeLists.txt", "license": "mit", "size": 699} |
### File: googlenet/googlenet.cpp
#include "NvInfer.h"
#include "cuda_runtime_api.h"
#include "logging.h"
#include <fstream>
#include <map>
#include <chrono>
#include <cmath>
#define CHECK(status) \
do\
{\
auto ret = (status);\
if (ret != 0)\
{\
std::cerr << "Cuda failure: "... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "googlenet/googlenet.cpp", "license": "mit", "size": 14269} |
### File: googlenet/logging.h
/*
* Copyright (c) 2019, 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/L... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "googlenet/logging.h", "license": "mit", "size": 16550} |
### File: hrnet/hrnet-image-classification/CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(hrnet)
add_definitions(-std=c++11)
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)
find_package(CUDA REQUIRED)
include_directories(/usr/local/cuda/include)
link_direc... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/tensorrtx", "path": "hrnet/hrnet-image-classification/CMakeLists.txt", "license": "mit", "size": 562} |
### File: hrnet/hrnet-image-classification/common.hpp
#pragma once
#include <fstream>
#include <map>
#include <sstream>
#include <vector>
#include <opencv2/opencv.hpp>
#include <dirent.h>
#include "NvInfer.h"
#include "NvInferPlugin.h"
#include "cuda_runtime_api.h"
using namespace nvinfer1;
#define CHECK(status) \
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "hrnet/hrnet-image-classification/common.hpp", "license": "mit", "size": 13034} |
### File: hrnet/hrnet-image-classification/demo.py
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# Copyright (c) Microsoft
# Licensed under the MIT License.
# Written by Bin Xiao (Bin.Xiao@microsoft.com)
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/tensorrtx", "path": "hrnet/hrnet-image-classification/demo.py", "license": "mit", "size": 4368} |
### File: hrnet/hrnet-image-classification/logging.h
/*
* Copyright (c) 2019, 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://ww... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "hrnet/hrnet-image-classification/logging.h", "license": "mit", "size": 16550} |
### File: hrnet/hrnet-semantic-segmentation/CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(hrnetseg)
add_definitions(-std=c++11)
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)
find_package(CUDA REQUIRED)
include_directories(${PROJECT_SOURCE_DIR}/include)... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/tensorrtx", "path": "hrnet/hrnet-semantic-segmentation/CMakeLists.txt", "license": "mit", "size": 1124} |
### File: hrnet/hrnet-semantic-segmentation/common.hpp
#pragma once
#include <fstream>
#include <map>
#include <sstream>
#include <vector>
#include <opencv2/opencv.hpp>
#include <dirent.h>
#include "NvInfer.h"
#include "NvInferPlugin.h"
#include "cuda_runtime_api.h"
using namespace nvinfer1;
#define CHECK(status) ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "hrnet/hrnet-semantic-segmentation/common.hpp", "license": "mit", "size": 15941} |
### File: hrnet/hrnet-semantic-segmentation/gen_wts.py
import argparse
import struct
import _init_paths
import models
import torch
from config import config, update_config
def parse_args():
parser = argparse.ArgumentParser(description="Train keypoints network")
parser.add_argument("--cfg", help="experiment ... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/tensorrtx", "path": "hrnet/hrnet-semantic-segmentation/gen_wts.py", "license": "mit", "size": 1741} |
### File: hrnet/hrnet-semantic-segmentation/hrnet.cpp
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
#include <vector>
#include <chrono>
#include "common.hpp"
#include "logging.h"
static Logger gLogger;
#define USE_FP32
#define DEVICE 0 // GPU id
#define BATCH_SIZE 1
const char *INPUT_BLOB_N... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "hrnet/hrnet-semantic-segmentation/hrnet.cpp", "license": "mit", "size": 41712} |
### File: hrnet/hrnet-semantic-segmentation/hrnet_ocr.cpp
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
#include <vector>
#include <chrono>
#include "common.hpp"
#include "logging.h"
static Logger gLogger;
#define USE_FP32
#define DEVICE 0 // GPU id
#define BATCH_SIZE 1 //
const char *I... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "hrnet/hrnet-semantic-segmentation/hrnet_ocr.cpp", "license": "mit", "size": 47536} |
### File: hrnet/hrnet-semantic-segmentation/hrnet_trt.py
"""
An example that uses TensorRT's Python api to make inferences for hrnet.
"""
import os
import shutil
import random
import sys
import threading
import time
import cv2
import numpy as np
import pycuda.autoinit
import pycuda.driver as cuda
import tensorrt as trt... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/tensorrtx", "path": "hrnet/hrnet-semantic-segmentation/hrnet_trt.py", "license": "mit", "size": 7715} |
### File: hrnet/hrnet-semantic-segmentation/logging.h
/*
* Copyright (c) 2019, 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://w... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "hrnet/hrnet-semantic-segmentation/logging.h", "license": "mit", "size": 16550} |
### File: ibnnet/CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(IBNNet)
add_definitions(-std=c++11)
option(CUDA_USE_STATIC_CUDA_RUNTIME OFF)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_BUILD_TYPE Debug)
find_package(CUDA REQUIRED)
include_directories(${PROJECT_SOURCE_DIR}/include)
# include and link dirs of c... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/tensorrtx", "path": "ibnnet/CMakeLists.txt", "license": "mit", "size": 964} |
### File: ibnnet/InferenceEngine.cpp
#include "InferenceEngine.h"
namespace trt {
InferenceEngine::InferenceEngine(const EngineConfig &enginecfg): _engineCfg(enginecfg) {
assert(_engineCfg.max_batch_size > 0);
CHECK(cudaSetDevice(_engineCfg.device_id));
_runtime = make_holder(nvinfer1::... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "ibnnet/InferenceEngine.cpp", "license": "mit", "size": 3718} |
### File: ibnnet/InferenceEngine.h
/**************************************************************************
* Handle memory pre-alloc
* both on host(pinned memory, allow CUDA DMA) & device
*************************************************************************/
#pragma once
#include <thread>
#include <chrono>
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/tensorrtx", "path": "ibnnet/InferenceEngine.h", "license": "mit", "size": 2325} |
### File: ibnnet/gen_wts.py
import torch
import os
import sys
import struct
assert sys.argv[1] == "a" or sys.argv[1] == "b"
model_name = "resnet50_ibn_" + sys.argv[1]
net = torch.hub.load('XingangPan/IBN-Net', model_name, pretrained=True).to('cuda:0').eval()
#verify
#input = torch.ones(1, 3, 224, 224).to('cuda:0')
... | {"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/tensorrtx", "path": "ibnnet/gen_wts.py", "license": "mit", "size": 837} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.