This class allows you to work with Darknet/YOLO neural networks. More...
Public Member Functions | |
| Darknet () | |
| Constructor. | |
| void | fix_out_of_bound_values (boolean toggle) throws Throwable |
| Fix out-of-bound values, meaning coordinates, widths, or heights that extend past the edges of images will be cropped or adjusted. | |
| void | free_image (MemorySegment image) throws Throwable |
| Free an image that was loaded with Darknet.Darknet.load_image(). | |
| void | free_neural_network () throws Throwable |
| Free the Darknet/YOLO neural network loaded by Darknet.Darknet.load_neural_network(). | |
| MemorySegment | load_image (String filename) throws Throwable |
| Load the given image and convert it to a "DarknetImage" type. | |
| MemorySegment | load_neural_network (String config, String names, String weights) throws Throwable |
| Load the Darknet/YOLO neural network. | |
| Map< String, Integer > | network_dimensions () throws Throwable |
| Get the network dimensions. | |
| void | set_detection_threshold (float threshold) throws Throwable |
| Set the detection threshold. | |
| void | set_gpu_index (int idx) throws Throwable |
| Set the zero-based GPU index Darknet should use. | |
| void | set_non_maximal_suppression_threshold (float threshold) throws Throwable |
| Set the NMS threshold. | |
| void | set_output_stream (String output_filename) throws Throwable |
| Set the filename into which Darknet will write console output. | |
| void | set_trace (boolean flag) throws Throwable |
| Toggle trace output. | |
| void | set_verbose (boolean flag) throws Throwable |
| Toggle verbose output. | |
| void | show_version_info () throws Throwable |
Display version information on STDOUT. | |
| void | testing () throws Throwable |
| String | version_short () throws Throwable |
| Get the short version string. | |
| String | version_string () throws Throwable |
| Get the full version string. | |
This class allows you to work with Darknet/YOLO neural networks.
| Darknet.Darknet.Darknet | ( | ) |
| void Darknet.Darknet.fix_out_of_bound_values | ( | boolean | toggle | ) | throws Throwable |
Fix out-of-bound values, meaning coordinates, widths, or heights that extend past the edges of images will be cropped or adjusted.
Default setting is true.
| void Darknet.Darknet.free_image | ( | MemorySegment | image | ) | throws Throwable |
Free an image that was loaded with Darknet.Darknet.load_image().
| void Darknet.Darknet.free_neural_network | ( | ) | throws Throwable |
Free the Darknet/YOLO neural network loaded by Darknet.Darknet.load_neural_network().
It is safe to call this multiple times.
| MemorySegment Darknet.Darknet.load_image | ( | String | filename | ) | throws Throwable |
Load the given image and convert it to a "DarknetImage" type.
| MemorySegment Darknet.Darknet.load_neural_network | ( | String | config, |
| String | names, | ||
| String | weights | ||
| ) | throws Throwable |
Load the Darknet/YOLO neural network.
Many Darknet calls require this to have been called, since this sets the neural network pointer. Remember to call Darknet.Darknet.free_neural_network() when done.
| Map< String, Integer > Darknet.Darknet.network_dimensions | ( | ) | throws Throwable |
Get the network dimensions.
The map will contain 3 entries: width, height, and channel.
| void Darknet.Darknet.set_detection_threshold | ( | float | threshold | ) | throws Throwable |
Set the detection threshold.
Default threshold setting is 0.25.
| void Darknet.Darknet.set_gpu_index | ( | int | idx | ) | throws Throwable |
Set the zero-based GPU index Darknet should use.
0 (zero) which is the default.-1.| void Darknet.Darknet.set_non_maximal_suppression_threshold | ( | float | threshold | ) | throws Throwable |
Set the NMS threshold.
Default NMS setting is 0.45.
| void Darknet.Darknet.set_output_stream | ( | String | output_filename | ) | throws Throwable |
Set the filename into which Darknet will write console output.
Default is STDOUT. This may be called prior to Darknet.Darknet.load_neural_network(). Use a blank filename ("") to reset it to the default STDOUT.
| void Darknet.Darknet.set_trace | ( | boolean | flag | ) | throws Throwable |
Toggle trace output.
This is only intended for debugging. Default trace setting is false. This may be called prior to Darknet.Darknet.load_neural_network().
| void Darknet.Darknet.set_verbose | ( | boolean | flag | ) | throws Throwable |
Toggle verbose output.
Default verbose setting is false. This may be called prior to Darknet.Darknet.load_neural_network().
| void Darknet.Darknet.show_version_info | ( | ) | throws Throwable |
Display version information on STDOUT.
This may be called prior to Darknet.Darknet.load_neural_network().
Example:
| void Darknet.Darknet.testing | ( | ) | throws Throwable |
| String Darknet.Darknet.version_short | ( | ) | throws Throwable |
Get the short version string.
For example, "5.0.138". This may be called prior to Darknet.Darknet.load_neural_network().
| String Darknet.Darknet.version_string | ( | ) | throws Throwable |
Get the full version string.
For example, "v5.0-138-ga061d2f0". This may be called prior to Darknet.Darknet.load_neural_network().