Skip to content

Commit

Permalink
packaging instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
adynathos committed Sep 21, 2019
1 parent 790ec56 commit 6229ab1
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 26 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ dist
build
label-grab-exe.spec
label-grab.spec
label-grab-win.spec
15 changes: 8 additions & 7 deletions PyInstaller.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@

## Install PyInstaller

We need to install PyInstaller from an unmerged oull request which fixes an error with PySide2:

<https://github.com/sjackso/pyinstaller/tree/fix_3689>

Maybe it will be merged into release some day.
```bash
pip install pyinstaller
```

## Build

Expand All @@ -26,13 +24,16 @@ pyinstaller main.py --name label-grab --add-data label_grab/resources/:label_gra

Windows for some reason wants `;` instead of `:`
```bash
# prepare Windows icon
magick label_grab/resources/label-grab-icon.svg -define icon:auto-resize=64,48,32,16 -background none build/label-grab-icon.ico
# single executable
pyinstaller main.py --name label-grab-win --onefile --add-data "label_grab/resources/;label_grab/resources"
pyinstaller main.py --name label-grab-win --add-data "label_grab/resources/;label_grab/resources" --icon build/label-grab-icon.ico --onefile
# directory
pyinstaller main.py --name label-grab-win --add-data "label_grab/resources/;label_grab/resources"
pyinstaller main.py --name label-grab-win --add-data "label_grab/resources/;label_grab/resources" --icon build/label-grab-icon.ico
```

## AppImage
For Linux, turn the directory into a single executable using [AppImage](https://appimage.org/).

* Install `appimagetool` from <https://github.com/AppImage/AppImageKit/releases>.

Expand Down
43 changes: 24 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ This tool is part of the following article:

[**Detecting the Unexpected via Image Resynthesis**](https://arxiv.org/abs/1904.07595)
*Krzysztof Lis, Krishna Nakka, Pascal Fua, Mathieu Salzmann*
[ArXiv](https://arxiv.org/abs/1904.07595), 2019

ICCV 2019

## Demo

Expand All @@ -23,41 +22,47 @@ This tool is part of the following article:
<img src="doc/label_grab_example.jpg" />
</a>

## Installation
Install the following python modules:
```
pip install numpy opencv-python imageio click qtpy pyside2 qimage2ndarray
```
## Packaged executables

It also needs Qt 5.11 or higher libraries on the system.
On Linux, these are in the repositories.
We provide packages make using [pyinstaller](https://www.pyinstaller.org/).
Running the executables below requires no installation.

On Windows, they can be downloaded [here](https://www.qt.io/download-qt-installer).
After installation, set the environemnt variables:
* `QT_PLUGIN_PATH` to `Qt\5.12.1\msvc2017_64\plugins`
* `QML2_IMPORT_PATH` to `Qt\5.12.1\msvc2017_64\qml`
* [label-grab.AppImage](releases/download/v1.0.1/label-grab.AppImage) - Linux - AppImage: to make it run, give the file the *executable* permission
* [label-grab-win.exe](releases/download/v1.0.1/label-grab-win.exe) - Windows - Single Executable: single .exe but takes some time to decompress on each start
* [label-grab-win.7z](releases/download/v1.0.1/label-grab-win.7z) - Windows - Directory: directory with the exe and all dependencies

where `Qt` is the installation directory.

We plan to package all the necessary files with [pyinstaller](https://www.pyinstaller.org/).
## Installation - from source
Install the following python modules:
```
pip install numpy opencv-python imageio click qtpy pyside2 qimage2ndarray
```
and run
```
python -m label_grab --config my_config.json
```

#### Conflict with `conda` installation

If you have a `conda` python installation, it may happen that you have conda `qt` and `pyqt` packages installed (they get installed together with unrelated libraries like matplotlib).
These packages have an old Qt version and cause this program to crash.
There are several ways to solve this:

* Remove the packages from conda if you don't need them: `conda remove qt pyqt --force`

* Create a new conda environment and install the packages from pip using the command above.

* Remove the packages from conda if you don't need them: `conda remove qt pyqt --force`

## Usage

Run
Run (for source installation)
```
cd path_to_cloned_repo
python -m label_grab --config my_config.json
```
or (for executable)
```
chmod +x label-grab.AppImage
./label-grab.AppImage --config my_config.json
```

The config file specifies the semantic classes, for example:
```json
Expand Down

0 comments on commit 6229ab1

Please sign in to comment.