Compare commits

..

2 commits

Author SHA1 Message Date
Nicholas Young
f7a5497f0c outputting output data to stdout 2024-10-18 22:22:39 -07:00
Nicholas Young
d2f585af6c fixed reference issue 2024-10-18 17:40:44 -07:00

View file

@ -7,7 +7,7 @@ const hlo = @cImport({
const Allocator = std.mem.Allocator; const Allocator = std.mem.Allocator;
const assert = std.debug.assert; const assert = std.debug.assert;
const hef_file = "yolov3.hef"; const hef_file = "yolov7.hef";
const max_edge_layers = 32; const max_edge_layers = 32;
@ -106,7 +106,7 @@ pub fn main() !void {
status = hlo.hailo_get_input_vstream_info(input_vstreams[0], &stream_info); status = hlo.hailo_get_input_vstream_info(input_vstreams[0], &stream_info);
assert(status == hlo.HAILO_SUCCESS); assert(status == hlo.HAILO_SUCCESS);
var output_info: hlo.hailo_output_vstream_info = undefined; var output_info: hlo.hailo_vstream_info_t = undefined;
status = hlo.hailo_get_output_vstream_info(output_vstreams[0], &output_info); status = hlo.hailo_get_output_vstream_info(output_vstreams[0], &output_info);
assert(status == hlo.HAILO_SUCCESS); assert(status == hlo.HAILO_SUCCESS);
std.debug.print("\nOutput info: {any}\n\n", .{ output_info }); std.debug.print("\nOutput info: {any}\n\n", .{ output_info });
@ -120,8 +120,10 @@ pub fn main() !void {
assert(status == hlo.HAILO_SUCCESS); assert(status == hlo.HAILO_SUCCESS);
std.debug.print("input flushed!\n", .{}); std.debug.print("input flushed!\n", .{});
var output_frame_size: usize = 0; var output_frame_size: usize = 0;
status = hlo.hailo_get_output_vstream_frame_size(input_vstreams[0], &output_frame_size); status = hlo.hailo_get_output_vstream_frame_size(output_vstreams[0], &output_frame_size);
assert(status == hlo.HAILO_SUCCESS); assert(status == hlo.HAILO_SUCCESS);
std.debug.print("output frame size is: {d}\n", .{ output_frame_size }); std.debug.print("output frame size is: {d}\n", .{ output_frame_size });
@ -130,6 +132,9 @@ pub fn main() !void {
status = hlo.hailo_vstream_read_raw_buffer(output_vstreams[0], output_data.ptr, output_frame_size); status = hlo.hailo_vstream_read_raw_buffer(output_vstreams[0], output_data.ptr, output_frame_size);
assert(status == hlo.HAILO_SUCCESS); assert(status == hlo.HAILO_SUCCESS);
std.debug.print("Output finished reading! Cleanup time\n", .{});
std.debug.print("good luck\n\n{x}", .{ output_data });
_ = hlo.hailo_release_output_vstreams(&output_vstreams, output_vstream_size); _ = hlo.hailo_release_output_vstreams(&output_vstreams, output_vstream_size);