YOLO- Unable to init server: Could not connect: Connection refused

  google-colaboratory, neural-network, python, yolo

I’ve trained a yolov4 neural network to detect pens. Everything has gone currectly, but when I try to test my model, its just not working. Here’s what it’s showing-

enter image description here

Here’s the command-

!./darknet detector test data/obj.data cfg/yolov4-custom.cfg /mydrive/YOLOV4/training/yolov4-custom_last.weights /mydrive/image1.jpeg 
imShow('predictions.jpg')

I dont know if this is relevant, but here’s the imshow function-

def imShow(path):
  import cv2
  import matplotlib.pyplot as plt
  %matplotlib inline

  image = cv2.imread(path)
  height, width = image.shape[:2]
  resized_image = cv2.resize(image,(3*width, 3*height), interpolation = cv2.INTER_CUBIC)

  fig = plt.gcf()
  fig.set_size_inches(18, 10)
  plt.axis("off")
  plt.imshow(cv2.cvtColor(resized_image, cv2.COLOR_BGR2RGB))
  plt.show()

Someone please help me fix this issue. Thanks a lot!

Source: Python Questions

LEAVE A COMMENT