This file contains hidden or 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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Runtime.InteropServices; | |
using Unity.Barracuda; | |
using UnityEngine; | |
using Random = UnityEngine.Random; | |
public class Inferer : MonoBehaviour, InputHandler | |
{ |
This file contains hidden or 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
down_sized_altair = [] | |
img_data = [] | |
img_shape = down_sized[10].shape | |
for index, image in enumerate(down_sized[0:10]): | |
for y in range(img_shape[0]): | |
for x in range(img_shape[1]): | |
pixel_color = image[y][x]/255 | |
img_data.append((index, x+.5, img_shape[0]-y-.5, rgb2hex(pixel_color), explore_counts[index])) | |
down_sized_altair.append(img_data) | |
This file contains hidden or 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
img_data = [] | |
img_shape = image.shape | |
# I am sure there is a less loopy way of doing this. | |
for y in range(img_shape[0]): | |
for x in range(img_shape[1]): | |
pixel_color = image[y][x] | |
# Add a .5 offset and convert from RGB to Hex. | |
img_data.append((x +.5, y + .5, rgb2hex(pixel_color))) |