A class that represents a Darknet/YOLO configuration file.
More...
#include "darknet_cfg.hpp"
|
| CfgFile () |
| Consructor.
|
|
| CfgFile (const std::filesystem::path &fn) |
| Consructor. This automatically calls read().
|
|
| ~CfgFile () |
| Destructor.
|
|
CfgFile & | clear () |
| Reset the config file to be empty.
|
|
Darknet::Network & | create_network (const int batch=1, int time_steps=1) |
| Create and populate the Darknet Darknet::Network object net from the configuration that was parsed.
|
|
std::string | debug () const |
| Iterate over the content to record some debug information about the configuration.
|
|
bool | empty () const |
| Determine if a .cfg file has been parsed.
|
|
CfgFile & | read () |
| Read the specified configuration file.
|
|
CfgFile & | read (const std::filesystem::path &fn) |
| Read the given configuration file and parses the individual sections and lines.
|
|
A class that represents a Darknet/YOLO configuration file.
Contains various sections, which in turn has lines representing all of the options for each given section. Typical use is to call read() followed by create_network().
◆ CfgFile() [1/2]
Darknet::CfgFile::CfgFile |
( |
| ) |
|
◆ CfgFile() [2/2]
Darknet::CfgFile::CfgFile |
( |
const std::filesystem::path & |
fn | ) |
|
Consructor. This automatically calls read().
◆ ~CfgFile()
Darknet::CfgFile::~CfgFile |
( |
| ) |
|
◆ clear()
Reset the config file to be empty.
- Note
- This does not call free_network().
◆ create_network()
Darknet::Network & Darknet::CfgFile::create_network |
( |
const int |
batch = 1 , |
|
|
int |
time_steps = 1 |
|
) |
| |
◆ debug()
std::string Darknet::CfgFile::debug |
( |
| ) |
const |
Iterate over the content to record some debug information about the configuration.
◆ empty()
bool Darknet::CfgFile::empty |
( |
| ) |
const |
|
inline |
Determine if a .cfg file has been parsed.
◆ parse_avgpool_section()
Darknet::Layer Darknet::CfgFile::parse_avgpool_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_connected_section()
Darknet::Layer Darknet::CfgFile::parse_connected_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_contrastive_section()
Darknet::Layer Darknet::CfgFile::parse_contrastive_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_convolutional_section()
Darknet::Layer Darknet::CfgFile::parse_convolutional_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_cost_section()
Darknet::Layer Darknet::CfgFile::parse_cost_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_crnn_section()
Darknet::Layer Darknet::CfgFile::parse_crnn_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_dropout_section()
Darknet::Layer Darknet::CfgFile::parse_dropout_section |
( |
const size_t |
section_idx | ) |
|
|
private |
<
- Todo:
- why read in a float and then store it in an int?
◆ parse_gaussian_yolo_section()
Darknet::Layer Darknet::CfgFile::parse_gaussian_yolo_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_local_avgpool_section()
Darknet::Layer Darknet::CfgFile::parse_local_avgpool_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_lstm_section()
Darknet::Layer Darknet::CfgFile::parse_lstm_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_maxpool_section()
Darknet::Layer Darknet::CfgFile::parse_maxpool_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_net_section()
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_region_section()
Darknet::Layer Darknet::CfgFile::parse_region_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_reorg_section()
Darknet::Layer Darknet::CfgFile::parse_reorg_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_rnn_section()
Darknet::Layer Darknet::CfgFile::parse_rnn_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_route_section()
Darknet::Layer Darknet::CfgFile::parse_route_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_sam_section()
Darknet::Layer Darknet::CfgFile::parse_sam_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_scale_channels_section()
Darknet::Layer Darknet::CfgFile::parse_scale_channels_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_shortcut_section()
Darknet::Layer Darknet::CfgFile::parse_shortcut_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_softmax_section()
Darknet::Layer Darknet::CfgFile::parse_softmax_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_upsample_section()
Darknet::Layer Darknet::CfgFile::parse_upsample_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ parse_yolo_section()
Darknet::Layer Darknet::CfgFile::parse_yolo_section |
( |
const size_t |
section_idx | ) |
|
|
private |
Methods to parse different types of sections in
.cfg files. These are called from Darknet::CfgFile::read() and are not meant to be called directly.
◆ read() [1/2]
Read the specified configuration file.
If you use the constructor where a filename is specified, then you don't need to manually call read()
. The constructor will automatically call this method for you.
- Note
- Remember to call create_network() after
read()
has finished.
◆ read() [2/2]
Read the given configuration file and parses the individual sections and lines.
Forgets about any configuration file specified in the constructor (if any).
- Note
- Remember to call create_network() after
read()
has finished.
◆ filename
std::filesystem::path Darknet::CfgFile::filename |
◆ net
◆ network_section
The
[net] or
[network] is not a "real" section, nor is it a layer.
This object is only populated after Darknet::CfgFile::read() has been called.
- See also
- sections
◆ parms
◆ sections
◆ total_lines
size_t Darknet::CfgFile::total_lines |
The total number of lines that was parsed from the
.cfg file, including comments and blank lines.
This also acts as a line counter while the
.cfg file is being parsed by Darknet::CfgFile::read().
The documentation for this class was generated from the following files: