Hello,
I am working on object detection(YOLO) inside the ROS2 node. I trained my model from colab and load it in py. code. However, when I give an image inside the model, I got this error :
TypeError: ‘dict’ object is not callable
What is the solution in my case?
import torch
import torch.nn as nn
import os
import subprocess
import sys
import sys
sys.path.insert(0, '/home/mev/ObjectDetection/yolov7')
print(os.getcwd())
os.chdir(r"/home/mev/ObjectDetection/yolov7")
print(os.getcwd())
PATH = os.getcwd()
if torch.cuda.is_available():
map_location=lambda storage, loc: storage.cuda()
else:
map_location='cpu'
model = torch.load('./yolov7.pt', map_location=map_location)
print(model)
img_fdr="./image.png"
processed_image = model(img_fdr)