remove numpy and jsos dependencies, and download pytqt for windows
This commit is contained in:
parent
16e6742094
commit
3bbf5e23e5
1
build-tools/.gitignore
vendored
1
build-tools/.gitignore
vendored
@ -6,3 +6,4 @@ python-2.*
|
|||||||
pywin32*
|
pywin32*
|
||||||
virtual-wine
|
virtual-wine
|
||||||
venv_wine
|
venv_wine
|
||||||
|
PyQt4-*
|
||||||
|
|||||||
@ -1,9 +1,14 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
THIS_SCRIPT_PATH=`readlink -f $0`
|
||||||
|
THIS_SCRIPT_DIR=`dirname ${THIS_SCRIPT_PATH}`
|
||||||
#OS Ubuntu 14.04
|
#OS Ubuntu 14.04
|
||||||
### Common packages for linux/windows
|
### Common packages for linux/windows
|
||||||
if [ ! -e "pyinstaller" ]; then
|
if [ ! -e "pyinstaller" ]; then
|
||||||
git clone https://github.com/pyinstaller/pyinstaller
|
git clone https://github.com/pyinstaller/pyinstaller
|
||||||
|
cd pyinstaller
|
||||||
|
git checkout v2.1 -b v2.1
|
||||||
|
cd ${THIS_SCRIPT_DIR}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Going to clone and download packages for building windows"
|
echo "Going to clone and download packages for building windows"
|
||||||
@ -38,5 +43,10 @@ if [ ! -e "pywin32-218.win32-py2.7.exe" ]; then
|
|||||||
wget "http://nchc.dl.sourceforge.net/project/pywin32/pywin32/Build%20218/pywin32-218.win32-py2.7.exe"
|
wget "http://nchc.dl.sourceforge.net/project/pywin32/pywin32/Build%20218/pywin32-218.win32-py2.7.exe"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ ! -e "PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe" ]; then
|
||||||
|
wget "http://nchc.dl.sourceforge.net/project/pyqt/PyQt4/PyQt-4.11.4/PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe"
|
||||||
|
fi
|
||||||
|
|
||||||
wine msiexec -i python-2.7.8.msi
|
wine msiexec -i python-2.7.8.msi
|
||||||
wine pywin32-218.win32-py2.7.exe
|
wine pywin32-218.win32-py2.7.exe
|
||||||
|
wine PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe
|
||||||
|
|||||||
@ -4,8 +4,6 @@
|
|||||||
from PyQt4.QtGui import QImage
|
from PyQt4.QtGui import QImage
|
||||||
from base64 import b64encode, b64decode
|
from base64 import b64encode, b64decode
|
||||||
from pascal_voc_io import PascalVocWriter
|
from pascal_voc_io import PascalVocWriter
|
||||||
import json
|
|
||||||
import numpy
|
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -23,38 +21,6 @@ class LabelFile(object):
|
|||||||
if filename is not None:
|
if filename is not None:
|
||||||
self.load(filename)
|
self.load(filename)
|
||||||
|
|
||||||
def load(self, filename):
|
|
||||||
try:
|
|
||||||
with open(filename, 'rb') as f:
|
|
||||||
data = json.load(f)
|
|
||||||
imagePath = data['imagePath']
|
|
||||||
imageData = b64decode(data['imageData'])
|
|
||||||
lineColor = data['lineColor']
|
|
||||||
fillColor = data['fillColor']
|
|
||||||
shapes = ((s['label'], s['points'], s['line_color'], s['fill_color'])\
|
|
||||||
for s in data['shapes'])
|
|
||||||
# Only replace data after everything is loaded.
|
|
||||||
self.shapes = shapes
|
|
||||||
self.imagePath = imagePath
|
|
||||||
self.imageData = imageData
|
|
||||||
self.lineColor = lineColor
|
|
||||||
self.fillColor = fillColor
|
|
||||||
except Exception, e:
|
|
||||||
raise LabelFileError(e)
|
|
||||||
|
|
||||||
def save(self, filename, shapes, imagePath, imageData,
|
|
||||||
lineColor=None, fillColor=None):
|
|
||||||
try:
|
|
||||||
with open(filename, 'wb') as f:
|
|
||||||
json.dump(dict(
|
|
||||||
shapes=shapes,
|
|
||||||
lineColor=lineColor, fillColor=fillColor,
|
|
||||||
imagePath=imagePath,
|
|
||||||
imageData=b64encode(imageData)),
|
|
||||||
f, ensure_ascii=True, indent=2)
|
|
||||||
except Exception, e:
|
|
||||||
raise LabelFileError(e)
|
|
||||||
|
|
||||||
def savePascalVocFormat(self, filename, shapes, imagePath, imageData,
|
def savePascalVocFormat(self, filename, shapes, imagePath, imageData,
|
||||||
lineColor=None, fillColor=None, databaseSrc=None):
|
lineColor=None, fillColor=None, databaseSrc=None):
|
||||||
imgFolderPath = os.path.dirname(imagePath)
|
imgFolderPath = os.path.dirname(imagePath)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user