Sfoglia il codice sorgente

Call matplotlib.use('Agg') in json_to_dataset.py

Kentaro Wada 7 anni fa
parent
commit
190ca95fdb
2 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. 0 1
      .travis.yml
  2. 5 4
      labelme/cli/json_to_dataset.py

+ 0 - 1
.travis.yml

@@ -11,7 +11,6 @@ matrix:
         - SYSTEM_PYTHON=/usr/bin/python
         - PIP=pip
         - PYTHON=python
-        - MPLBACKEND=Agg
       addons:
         apt:
           packages:

+ 5 - 4
labelme/cli/json_to_dataset.py

@@ -1,11 +1,12 @@
-#!/usr/bin/env python
-
 import argparse
 import json
 import os
 import os.path as osp
 import warnings
 
+import matplotlib
+matplotlib.use('Agg')
+
 import numpy as np
 import PIL.Image
 import yaml
@@ -15,8 +16,8 @@ from labelme import utils
 
 def main():
     warnings.warn("This script is aimed to demonstrate how to convert the\n"
-                "JSON file to a single image dataset, and not to handle\n"
-                "multiple JSON files to generate a real-use dataset.")
+                  "JSON file to a single image dataset, and not to handle\n"
+                  "multiple JSON files to generate a real-use dataset.")
 
     parser = argparse.ArgumentParser()
     parser.add_argument('json_file')