sthanhng / yoloface

Deep learning-based Face detection using the YOLOv3 algorithm (https://github.com/sthanhng/yoloface)
MIT License
450 stars 180 forks source link

Cannot connect to X server #20

Open kevinzezel opened 4 years ago

kevinzezel commented 4 years ago

I got this error:

----- info ----- [i] The config file: ./cfg/yolov3-face.cfg [i] The weights of model file: ./model-weights/yolov3-wider_16000.weights [i] Path to image file: samples/outside_000001.jpg [i] Path to video file: ###########################################################

==> Skipping create the outputs/ directory... : cannot connect to X server

AhmedKhaled945 commented 4 years ago

If you are using google colab, then it is the problem, because the inside file contains showing some windows and video capturing, which are services not allowed in google colab, try to edit the file to make it run with any named windows or webcam captures.

Vivek-23-Titan commented 4 years ago

You need to comment/remove all the cv2.windows commands as colab doesn't allow these optional window graphics. These following lines of code were changed for running yoloface on images:

def _main():

wind_name = 'face detection using YOLOv3'

#cv2.namedWindow(wind_name, cv2.WINDOW_NORMAL)

    #cv2.imshow(wind_name, frame)

    #key = cv2.waitKey(1)
    #if key == 27 or key == ord('q'):
    #    print('[i] ==> Interrupted by user!')
    #    break

#cap.release()
#cv2.destroyAllWindows()
Classsic commented 4 years ago

@Vivek-23-Titan thanks, that's work on command line vps. There is a way to get only the metadata of pixels position through command line? Great project.

Vivek-23-Titan commented 4 years ago

@Classsic , I am no expert but I think, I found something useful on this.

https://stackoverflow.com/questions/21697645/how-to-extract-metadata-from-a-image-using-python

Here, the meta data of an image is converted in a dictionary format. Hope this helps!