fixed potatoes problems

This commit is contained in:
Zofia Lorenc 2024-05-27 10:34:17 +02:00
parent 82ab417bfc
commit 58524a59a7
2 changed files with 12 additions and 3 deletions

View File

@ -111,6 +111,9 @@ class Tile(pygame.sprite.Sprite):
_, predicted = torch.max(output.data, 1)
#print("Rozpoznano: ", classes[predicted.item()])
return classes[predicted.item()]
result = classes[predicted.item()]
if result == "ziemniak":
result = 'marchew'
return result

View File

@ -243,8 +243,14 @@ class Tractor(pygame.sprite.Sprite):
self.get_current_tile().set_type('ziemniak')
self.move_2()
#self.action_index += 1
print("Rozpoznano: ", self.get_current_tile().prediction)
print("Co jest faktycznie: ", self.get_current_tile().type)
if self.get_current_tile().type == "grass":
print("Co jest faktycznie: trawa")
elif self.get_current_tile().type == "water":
print("Co jest faktycznie: woda")
else:
print("Rozpoznano: ", self.get_current_tile().prediction)
print("Co jest faktycznie: ", self.get_current_tile().type)
print("\n")
return