2
0
forked from s444420/AL-2020

agent can put one product.py

This commit is contained in:
shaaqu 2020-06-09 19:09:46 +02:00
parent d9c2092551
commit e1eab58672
4 changed files with 7 additions and 4 deletions

View File

@ -1,7 +1,7 @@
import cv2
import torch
from nn_model import Net
from torchvision.transforms import transforms
from codes_recognizer.network_model import Net
def recognizer(path):
@ -14,9 +14,8 @@ def recognizer(path):
# load nn model
model = Net()
model.load_state_dict(torch.load('model.pt'))
model.load_state_dict(torch.load('codes_recognizer/model.pt'))
model.eval()
img = cv2.imread(path)
img_gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

View File

@ -76,11 +76,14 @@ def run():
'''
# list [x, y]
dest_shelf = new_product.shelf()
dest_field = board[dest_shelf[0], dest_shelf[1]]
dest_field = board[dest_shelf[0]][dest_shelf[1]]
path = functions.a_star(board[agent.y][agent.x], dest_field, board)
''''''
agent.item = new_product
path.pop(len(path) - 1)
next_step = path.pop(len(path) - 1)
agent.is_busy = True
if next_step is not None:

View File

@ -32,4 +32,5 @@ class FinalProduct:
self.img = create_image(self)
def shelf(self):
print(self.img)
return assigning(self.img);