Model trainer: Add function to make tensor of cartesian coordinates for drawing the map (equirectangular projection)

[?]
Jul 1, 2021, 12:01 PM
ZRPV3GAJQYQLXVL5LS3TFKZACVXSL43WEEA6PKF6ZUWHDUIIDSBQC

Dependencies

  • [2] ROQCAPZJ Begin function for showing the map (for now just opens SDL window)

Change contents

  • edit in trainmodel/src/drawmap.py at line 1
    [2.13]
    [2.14]
    import math
  • edit in trainmodel/src/drawmap.py at line 5
    [2.53]
    [2.53]
    import tensorflow as tf
  • edit in trainmodel/src/drawmap.py at line 22
    [2.443]
    def inputs(width, height):
    def cartesian(x,y):
    x = x / width * math.pi
    y = y / height * math.pi
    return [math.sin(y) * math.cos(x), math.sin(y) * math.sin(x), math.cos(y)]
    def row(y):
    def c(x):
    return cartesian(x,y)
    return list(map(c, range(0, width)))
    return tf.constant(list(map(row, range(0, height))))