{"action":"created","issue":{"url":"https://api.github.com/repos/davisking/dlib/issues/15","labels_url":"https://api.github.com/repos/davisking/dlib/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/davisking/dlib/issues/15/comments","events_url":"https://api.github.com/repos/davisking/dlib/issues/15/events","html_url":"https://github.com/davisking/dlib/issues/15","id":85811173,"number":15,"title":"Using without an X server","user":{"login":"bamos","id":707462,"avatar_url":"https://avatars.githubusercontent.com/u/707462?v=3","gravatar_id":"","url":"https://api.github.com/users/bamos","html_url":"https://github.com/bamos","followers_url":"https://api.github.com/users/bamos/followers","following_url":"https://api.github.com/users/bamos/following{/other_user}","gists_url":"https://api.github.com/users/bamos/gists{/gist_id}","starred_url":"https://api.github.com/users/bamos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bamos/subscriptions","organizations_url":"https://api.github.com/users/bamos/orgs","repos_url":"https://api.github.com/users/bamos/repos","events_url":"https://api.github.com/users/bamos/events{/privacy}","received_events_url":"https://api.github.com/users/bamos/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-06T20:55:18Z","updated_at":"2015-06-07T12:35:35Z","closed_at":"2015-06-07T12:35:35Z","body":"Hi, I'd like to use dlib to batch process images on a server with X.\r\nIs there a flag I can set to enable this?\r\n\r\nThe first error I get is from matplotlib/pyplot:\r\n\r\n```\r\n(naive-dlib-frontalization.py:28314): Gdk-CRITICAL **: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed\r\nTraceback (most recent call last):\r\n  File \"./scripts/naive-dlib-frontalization.py\", line 19, in <module>\r\n    from skimage import io\r\n  File \"/usr/local/lib/python2.7/dist-packages/skimage/io/__init__.py\", line 15, in <module>\r\n    reset_plugins()\r\n  File \"/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py\", line 89, in reset_plugins\r\n    _load_preferred_plugins()\r\n  File \"/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py\", line 69, in _load_preferred_plugins\r\n    _set_plugin(p_type, preferred_plugins['all'])\r\n  File \"/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py\", line 81, in _set_plugin\r\n    use_plugin(plugin, kind=plugin_type)\r\n  File \"/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py\", line 251, in use_plugin\r\n    _load(name)\r\n  File \"/usr/local/lib/python2.7/dist-packages/skimage/io/manage_plugins.py\", line 295, in _load\r\n    fromlist=[modname])\r\n  File \"/usr/local/lib/python2.7/dist-packages/skimage/io/_plugins/matplotlib_plugin.py\", line 4, in <module>\r\n    import matplotlib.pyplot as plt\r\n  File \"/usr/local/lib/python2.7/dist-packages/matplotlib/pyplot.py\", line 109, in <module>\r\n    _backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()\r\n  File \"/usr/local/lib/python2.7/dist-packages/matplotlib/backends/__init__.py\", line 32, in pylab_setup\r\n    globals(),locals(),[backend_name],0)\r\n  File \"/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3agg.py\", line 11, in <module>\r\n    from . import backend_gtk3\r\n  File \"/usr/local/lib/python2.7/dist-packages/matplotlib/backends/backend_gtk3.py\", line 55, in <module>\r\n    cursors.MOVE          : Gdk.Cursor.new(Gdk.CursorType.FLEUR),\r\nTypeError: constructor returned NULL\r\n```\r\n\r\nI can get around this error with the following imports before importing dlib:\r\n\r\n```\r\nimport matplotlib as mpl\r\nmpl.use('Agg')\r\n```\r\n\r\nNext, I get the following error, which I'm not yet sure how to resolve.\r\n\r\n```\r\n 1029 FATAL [1] dlib.gui_core: Unable to connect to the X display.\r\nRuntimeError: Failed to initialize X11 resources\r\n```"},"comment":{"url":"https://api.github.com/repos/davisking/dlib/issues/comments/109748110","html_url":"https://github.com/davisking/dlib/issues/15#issuecomment-109748110","issue_url":"https://api.github.com/repos/davisking/dlib/issues/15","id":109748110,"user":{"login":"bamos","id":707462,"avatar_url":"https://avatars.githubusercontent.com/u/707462?v=3","gravatar_id":"","url":"https://api.github.com/users/bamos","html_url":"https://github.com/bamos","followers_url":"https://api.github.com/users/bamos/followers","following_url":"https://api.github.com/users/bamos/following{/other_user}","gists_url":"https://api.github.com/users/bamos/gists{/gist_id}","starred_url":"https://api.github.com/users/bamos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bamos/subscriptions","organizations_url":"https://api.github.com/users/bamos/orgs","repos_url":"https://api.github.com/users/bamos/repos","events_url":"https://api.github.com/users/bamos/events{/privacy}","received_events_url":"https://api.github.com/users/bamos/received_events","type":"User","site_admin":false},"created_at":"2015-06-07T12:35:35Z","updated_at":"2015-06-07T12:35:35Z","body":"Sorry, and thanks @davisking - I had a `dlib.image_window()` hidden in my code!\r\nIt's working well with an X server now. :-)\r\n\r\nGreat code btw!"}}