-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update with palettes and dual neural network
- Loading branch information
Showing
28 changed files
with
869 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
__pycache__ | ||
blender-3.3.1-linux-x64 | ||
data | ||
voxelsight.ckpt | ||
*.ckpt | ||
wandb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
downsample = 4 | ||
native_screen_res = (640, 360) | ||
# C x H x W | ||
screen_size = (4, int(360/downsample), int(640/downsample)) | ||
screen_size = (4, int(native_screen_res[1]/downsample), int(native_screen_res[0]/downsample)) | ||
quantized_screen_size = (screen_size[1] * screen_size[2], 2) | ||
|
||
voxel_grid_size = (16*16,) | ||
dataset_size = 1000 | ||
|
||
datasets = {'train':100} | ||
# datasets = {'train':5000, 'test':1000, 'validate':500} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
from PIL import Image | ||
from config import * | ||
import os | ||
|
||
dir = "data/" | ||
|
||
for i in range(dataset_size): | ||
with Image.open(dir + "occlusion_elements_{}.png".format(i)) as img: | ||
d = img.getdata() | ||
pixel_counts = {} | ||
for pixel in d: | ||
if pixel[3] > 0.0: | ||
pixel = pixel[:3] # remove alpha channel | ||
if pixel in pixel_counts: | ||
pixel_counts[pixel] = pixel_counts[pixel] + 1 | ||
else: | ||
pixel_counts[pixel] = 1 | ||
with open(dir + "voxel_scene_{}".format(i)) as scene: | ||
with open(dir + "visible_elements_{}".format(i), "w+") as visible: | ||
lines = scene.readlines() | ||
for line in lines: | ||
data = line.split("/") | ||
color = tuple([int(v) for v in data[1][1:-1].split(",")]) | ||
height = int(data[2]) | ||
if color in pixel_counts: | ||
visible.write(str(data[0]) + "," + str(height) + "," + str(pixel_counts[color]) + "\n") | ||
for dataset in datasets.items(): | ||
dir = os.path.join("data", dataset[0]) | ||
for i in range(dataset[1]): | ||
with Image.open(os.path.join(dir, "occlusion_elements_{}.png".format(i))) as img: | ||
d = img.getdata() | ||
pixel_counts = {} | ||
for pixel in d: | ||
if pixel[3] > 0.0: | ||
pixel = pixel[:3] # remove alpha channel | ||
if pixel in pixel_counts: | ||
pixel_counts[pixel] = pixel_counts[pixel] + 1 | ||
else: | ||
pixel_counts[pixel] = 1 | ||
with open(os.path.join(dir, "voxel_scene_{}".format(i))) as scene: | ||
with open(os.path.join(dir, "visible_elements_{}".format(i)), "w+") as visible: | ||
lines = scene.readlines() | ||
for line in lines: | ||
data = line.split("/") | ||
color = tuple([int(v) for v in data[1][1:-1].split(",")]) | ||
height = int(data[2]) | ||
if color in pixel_counts: | ||
visible.write(str(data[0]) + "," + str(height) + "," + str(pixel_counts[color]) + "\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
./blender-3.3.1-linux-x64/blender -b voxel.blend --python generate_dataset.py && | ||
python find_visible_voxels.py | ||
./blender-3.3.1-linux-x64/blender -b voxel.blend --python generate_dataset.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
load_scene = "/home/aeri/il/minerl/voxel_sight/data/train/voxel_scene_0" | ||
with open(load_scene) as scene: | ||
voxels = [line.strip() for line in scene.readlines()] | ||
print(voxels) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
2f1e1a | ||
4f3322 | ||
723627 | ||
95392c | ||
c75533 | ||
e76d46 | ||
934e28 | ||
a2663c | ||
c87d40 | ||
f5a95b | ||
6b8b8c | ||
81a38e | ||
aac39e | ||
ffffff | ||
d1d0ce | ||
bab7b2 | ||
898a8a | ||
686461 | ||
554d4b | ||
3c3d3b | ||
343230 | ||
87d1ef | ||
64a1c2 | ||
466480 | ||
2f485c | ||
242e35 | ||
1b2026 | ||
aa9c8a | ||
917f6d | ||
86624a | ||
715b48 | ||
5e4835 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
000000 | ||
222034 | ||
45283c | ||
663931 | ||
8f563b | ||
df7126 | ||
d9a066 | ||
eec39a | ||
fbf236 | ||
99e550 | ||
6abe30 | ||
37946e | ||
4b692f | ||
524b24 | ||
323c39 | ||
3f3f74 | ||
306082 | ||
5b6ee1 | ||
639bff | ||
5fcde4 | ||
cbdbfc | ||
ffffff | ||
9badb7 | ||
847e87 | ||
696a6a | ||
595652 | ||
76428a | ||
ac3232 | ||
d95763 | ||
d77bba | ||
8f974a | ||
8a6f30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
ede4da | ||
bfb8b4 | ||
918d8d | ||
636167 | ||
353540 | ||
a94949 | ||
ca5954 | ||
e56f4b | ||
e39347 | ||
eeb551 | ||
e8c65b | ||
bda351 | ||
8b9150 | ||
557d55 | ||
446350 | ||
3e554c | ||
8bb0ad | ||
769fa6 | ||
668da9 | ||
5c699f | ||
5a5888 | ||
7c6da2 | ||
947a9d | ||
bc87a5 | ||
d9a6a6 | ||
d4c2b6 | ||
bdaa97 | ||
86735b | ||
7e674c | ||
735b42 | ||
604b3d | ||
4d3f38 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
000000 | ||
180d2f | ||
353658 | ||
686b72 | ||
8b97b6 | ||
c5cddb | ||
ffffff | ||
5ee9e9 | ||
2890dc | ||
1831a7 | ||
053239 | ||
005f41 | ||
08b23b | ||
47f641 | ||
e8ff75 | ||
fbbe82 | ||
de9751 | ||
b66831 | ||
8a4926 | ||
461c14 | ||
1e090d | ||
720d0d | ||
813704 | ||
da2424 | ||
ef6e10 | ||
ecab11 | ||
ece910 | ||
f78d8d | ||
f94e6d | ||
c12458 | ||
841252 | ||
3d083b |
Oops, something went wrong.