7 Commits

Author SHA1 Message Date
c5ec89093d fix it 2026-03-27 09:51:08 -07:00
1fab9524bd copy graphical data 2026-03-27 09:34:33 -07:00
77fcb52731 sigmoid 2026-03-27 09:34:33 -07:00
5902f4fb1b png 2026-03-27 09:34:33 -07:00
1f7dbbfee9 png 2026-03-27 09:34:33 -07:00
f496b0ecb0 use none for rows_per_image 2026-03-27 09:34:33 -07:00
d60ba4da04 include world offset 2026-03-27 09:34:33 -07:00

View File

@@ -104,6 +104,9 @@ fn training() {
.unwrap();
let timelines =
strafesnet_roblox_bot_file::v0::read_all_to_block(std::io::Cursor::new(bot_file)).unwrap();
let bot = strafesnet_roblox_bot_player::bot::CompleteBot::new(timelines).unwrap();
let world_offset = bot.world_offset();
let timelines = bot.timelines();
// setup graphics
let desc = wgpu::InstanceDescriptor::new_without_display_handle_from_env();
@@ -252,6 +255,9 @@ fn training() {
fn a(a: v0::Vector3) -> [f32; 2] {
[a.y, a.x]
}
fn add<T: core::ops::Add>(lhs: T, rhs: T) -> T::Output {
lhs + rhs
}
let mut encoder = device.create_command_encoder(&wgpu::CommandEncoderDescriptor {
label: Some("wgpu encoder"),
@@ -261,7 +267,7 @@ fn training() {
graphics.encode_commands(
&mut encoder,
&graphics_texture_view,
p(output_event.event.position).into(),
add(world_offset, p(output_event.event.position).into()),
a(output_event.event.angles).into(),
);
@@ -279,7 +285,7 @@ fn training() {
offset: 0,
// This needs to be a multiple of 256.
bytes_per_row: Some(stride_size as u32),
rows_per_image: Some(size.y),
rows_per_image: None,
},
},
wgpu::Extent3d {
@@ -322,7 +328,7 @@ fn training() {
&inputs[i * INPUT..(i + 1) * INPUT]
.iter()
.copied()
.map(|f| (f * 255.0) as u8)
.map(|f| f as u8)
.collect::<Vec<u8>>(),
(SIZE_X, SIZE_Y),
format!("depth_images/{i}.png").into(),