File tree Expand file tree Collapse file tree 6 files changed +46
-16
lines changed Expand file tree Collapse file tree 6 files changed +46
-16
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,21 @@ language: python
33matrix :
44 include :
55 - python : 3.5
6+ - python : 2.7
67
78install :
89 - pip install numpy Pillow tqdm
10+ - if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
11+ pip install backports.tempfile;
12+ fi
913 - python setup.py install
1014 - pip install flake8 coveralls pytest-cov
1115
1216# command to run tests
1317script :
14- - py.test --cov image_dataset_viz --cov-report term-missing
1518 - flake8
19+ - py.test --cov image_dataset_viz --cov-report term-missing
20+
1621
1722after_success :
1823 - coveralls
Original file line number Diff line number Diff line change 55
66Observe dataset of images and targets in few shots
77
8- ** Python 3 only**
9-
108![ VEDAI example] ( examples/vedai_example.png )
119
1210## Descriptions
@@ -18,11 +16,11 @@ in few shots.
1816## Installation
1917
2018``` bash
21- python3 setup.py install
19+ python setup.py install
2220```
2321or
2422``` bash
25- pip3 install git+https://github.com/vfdev-5/ImageDatasetViz.git
23+ pip install git+https://github.com/vfdev-5/ImageDatasetViz.git
2624```
2725
2826## Usage
@@ -79,6 +77,7 @@ def read_img_fn(img_filepath):
7977```
8078and let's say the annotations are just lines with points and a label, e.g. ` 12 23 34 45 56 67 car `
8179``` python
80+ from pathlib import Path
8281import numpy as np
8382
8483def read_target_fn (target_filepath ):
Original file line number Diff line number Diff line change 11
22__version__ = '0.1'
33
4- from .dataset_exporter import DatasetExporter , render_datapoint
4+ from image_dataset_viz .dataset_exporter import DatasetExporter , render_datapoint
Original file line number Diff line number Diff line change 1+ from __future__ import division
12import sys
2- from pathlib import Path
3+
4+ try :
5+ from pathlib import Path
6+ except ImportError :
7+ from pathlib2 import Path
38
49import numpy as np
510from PIL import ImageDraw , ImageFont , Image
Original file line number Diff line number Diff line change 1- from codecs import open as codecs_open
1+ import os
2+ import io
3+ import re
24from setuptools import setup , find_packages
3- from image_dataset_viz import __version__
45
56
6- # Get the long description from the relevant file
7- with codecs_open ('README.md' , encoding = 'utf-8' ) as f :
8- long_description = f .read ()
7+ def read (* names , ** kwargs ):
8+ with io .open (os .path .join (os .path .dirname (__file__ ), * names ),
9+ encoding = kwargs .get ("encoding" , "utf8" )) as fp :
10+ return fp .read ()
11+
12+
13+ def find_version (* file_paths ):
14+ version_file = read (* file_paths )
15+ version_match = re .search (r"^__version__ = ['\"]([^'\"]*)['\"]" , version_file , re .M )
16+ if version_match :
17+ return version_match .group (1 )
18+ raise RuntimeError ("Unable to find version string." )
19+
20+
21+ long_description = read ("README.md" )
22+ version = find_version ('image_dataset_viz' , '__init__.py' )
923
1024
1125setup (
1226 name = "image_dataset_viz" ,
13- version = __version__ ,
27+ version = version ,
1428 description = u"Observe dataset of images and targets in few shots" ,
1529 long_description = long_description ,
1630 author = "vfdev-5" ,
1933 install_requires = [
2034 'numpy' ,
2135 'Pillow' ,
22- 'tqdm'
36+ 'tqdm' ,
37+ 'pathlib2;python_version<"3"'
2338 ],
2439 license = 'MIT' ,
2540 test_suite = "tests" ,
Original file line number Diff line number Diff line change 11
2- import tempfile
3- from pathlib import Path
2+ import sys
3+
4+ if sys .version_info [0 ] < 3 :
5+ from backports import tempfile
6+ from pathlib2 import Path
7+ else :
8+ import tempfile
9+ from pathlib import Path
410
511from unittest import TestCase , main
612
You can’t perform that action at this time.
0 commit comments