GithubHelp home page GithubHelp logo

detectron2_project's Introduction

Detectron2_Project

faster rcnn train and test

faster rcnn test

INTRODUCTION

you have the trained model file from the libtorch(detectron2)

windows10

  • dependency : libtorch 1.6.0 , cuda 10.2 , cudnn 7.6.5 , opencv4.3.0 , vs2019 , YAML_CPP

  • build:

    open Detectron2_Project.sln file

    Detectron2_test.cpp : test

    Detectron2_train.cpp : train

Model and 3rdparty

data:https://share.weiyun.com/io1NaIqT or https://drive.google.com/drive/folders/1bB0YqxwIA_oXjest2R4LMFmROzT2LIpF?usp=sharing

model : https://share.weiyun.com/fsB1QBM4 or https://drive.google.com/drive/folders/1DzBaLnso9HilOct7HcQdQl_GUrg9gc0s?usp=sharing

3rdparty:YAML_CPP/opencv4.3.0/libtorch-1.6.0

Train API

namespace Detectron2
{
	class Trainer {
	public:
		struct Options {
			std::string config_file					// path to config file
				= "configs/quick_schedules/mask_rcnn_R_50_FPN_inference_acc_test.yaml";
			bool webcam = false;
			std::vector<std::string> input;	
			CfgNode::OptionList opts;
			float confidence_threshold = 0.5;
		};
		static void start(const Options& options);

		static CfgNode setup_cfg(const std::string& config_file, const CfgNode::OptionList& opts,
			float confidence_threshold);

		void run_train();
	public:
		Trainer(const CfgNode& cfg, ColorMode instance_mode = ColorMode::kIMAGE, bool parallel = false);
	private:
		Metadata m_metadata;
		torch::Device m_cpu_device;
		ColorMode m_instance_mode;
		bool m_parallel;
		std::shared_ptr<TrainerBase> m_TrainerBase;
	};
}

test API

namespace Detectron2
{
	class VisualizationDemo {
	public:
		struct Options {
			std::string config_file					// path to config file
				= "configs/quick_schedules/mask_rcnn_R_50_FPN_inference_acc_test.yaml";
			bool webcam = false;
			std::string video_input;
			std::vector<std::string> input;			
			std::string output;						
			CfgNode::OptionList opts;				
			float confidence_threshold = 0.5; 		
		};
		static void start(const Options &options);

		static CfgNode setup_cfg(const std::string &config_file, const CfgNode::OptionList &opts,
			float confidence_threshold);
	public:
		VisualizationDemo(const CfgNode &cfg, ColorMode instance_mode = ColorMode::kIMAGE, bool parallel = false);
		std::tuple<InstancesPtr, VisImage> run_on_image(torch::Tensor image);

		void run_on_video(cv::VideoCapture &video, std::function<bool(cv::Mat)> vis_frame_processor);

		void analyze_on_video(cv::VideoCapture &video, VideoAnalyzer &analyzer);

	private:
		Metadata m_metadata;
		torch::Device m_cpu_device;
		ColorMode m_instance_mode;
		bool m_parallel;
		std::shared_ptr<Predictor> m_predictor;
	};
}

REFERENCE

https://github.com/LESSuseLESS/d2.git

Contact

detectron2_project's People

Contributors

ttanzhiqiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

detectron2_project's Issues

简化工程

这个工程监理有点复杂,请问有简化版本的吗

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.