This repository has been archived by the owner on Sep 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL.txt
141 lines (112 loc) · 6.45 KB
/
INSTALL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# Install
Please read this carefully until the end before proceeding.
The software was tested on:
* linux CentOS 7 (PyQt5 and python3 (v3.6.8 and v3.7.3))
* macOS HighSierra/Catalina/Big Sur/Monterey (up to python 3.7.13)
Hopefully, it will run on other linux distributions, MacOS and Windows with minor installation tweaks.
You will need a screen with minimum resolution of 1920*1080.
Download the latest released version and gunzip it or clone this repository with
wget https://github.com/LP-CDF/AMi_Image_Analysis/archive/vX.X.X.tar.gz .
or
git clone https://github.com/LP-CDF/AMi_Image_Analysis AMi_Image_Analysis
Dependencies:
* Python 3 (python <3.8 if you want to use TensorFlow 1.1x)
* Qt5
* PyQt5
* Python Imaging Library (Pillow, v6.2.1 or higher)
* PyFPDF (v1.7.2 or higher)
* Pandas
* Matplotlib
Optional dependencies:
* TensorFlow (v1.1x, not v2)
* MARCO tensorflow model (https://storage.googleapis.com/marco-168219-model/savedmodel.zip)
One version of this model is included in saved_model/
Methodology details are published in [[2]](#2)
* openCV for the automatic cropping tool (tested with opencv 4.0.1)
* NumPy
You may consider using a virtual environment to avoid python package conflict (recommended).
NEW installation description:
* Unzip/untar the archive
* Change to the directory containing the file Setup.py
* type "python3 Setup.py" to install with defaults or "python3 Setup.py -h" for help. If you are lucky, everything should be set properly.
Please note that only python dependencies are installed with the Setup.py script.
Type "python3 Setup.py --no-ProjectID" if your folder tree is without a ProjectID (see section "The following details MUST BE checked" case 1)
If necessary, you will have to manually install distribution specific packages.
If you have an "AZERTY" keyboard, use the option --FR.
* It is recommended to create an alias (e.g. for bash you can add in your .bashrc alias AMI_Image_Analysis='/whereveryouinstalled/bin/AMI_Image_Analysis.sh')
OLD installation description (still usefull in case of issues)
To create a virtual environment with venv adapt the following commands:
* python3 -m venv --without-pip /wherever/you/want/venvs/AMI_IMAGE_ANALYSIS_TENSORFLOW1
* source /wherever/you/want/venvs/AMI_IMAGE_ANALYSIS_TENSORFLOW1/bin/activate
* curl https://bootstrap.pypa.io/get-pip.py | python
* deactivate
* source /wherever/you/want/venvs/AMI_IMAGE_ANALYSIS_TENSORFLOW1/bin/activate
* python3 -m pip install -r /whereveryouinstalled/requirements.txt (or requirements_Raspbian.txt or requirements_OSX.txt)
* If you use a virtual environment, make sure it is activated before using the script Setup_local.py. This script will overwrite the file in
/whereveryouinstalled/bin/AMI_Image_Analysis.sh so that virtenv points to your virtual environment.
If you don't use a virtual environment, **do not use** the script Setup_local.py.
Check the file /whereveryouinstalled/bin/AMI_Image_Analysis.sh is executable.
It is recommended to create an alias (e.g. for bash you can add in your .bashrc alias AMI_Image_Analysis='/whereveryouinstalled/bin/AMI_Image_Analysis.sh')
then to start the program type in a bash terminal either type:
./whereveryouinstalled/bin/AMI_Image_Analysis.sh
or use your alias.
################################################################################################
The following details MUST BE checked:
If you have an AZERTY keyboard, use the '--FR' option with Setup.py or Setup_local.py (post-install).
If you use a QWERTY keyboard, you should not have to do anything.
FILE TREE:
The program can deal with the following trees given minor modifications are done (see below):
case 1 (No Project ID):
images
└──TargetID
└── PlateID
└── YYYYMMDD_HHMMSS
└── rawimages
case 2 (With Project ID):
images
└── ProjectID
└── TargetID
└── PlateID
└── YYYYMMDD_HHMMSS
└── rawimages
For case 1: Edit the file utils.py and check that you have the line 31 and 38
self.project=directory.parts[-4] #-5 if projectID is set. or -4
self.project=directory.parts[-3] #-4 if projectID is set. or -3
For case 2: Edit the file utils.py and check that you have the line
self.project=directory.parts[-5] #-5 if projectID is set. or -4
self.project=directory.parts[-4] #-4 if projectID is set. or -3
Or at setup, type "python3 Setup.py --no-ProjectID" if your folder tree is without a ProjectID (case 1).
If the folder containing the individual Z focused images is not named "rawimages" just edit the file "utils.py"
and modify the field _rawimages at line 4 accordingly before running Setup.py. However the organization of the
other folders must follow the previously described layout in FILE TREE.
# Known issues:
* If your CPU does not support AVX instruction sets (CPU before SandyBridge), you will need to find a tensorflow with the correct building options
(have a look [here](https://github.com/yaroslavvb/tensorflow-community-wheels/issues)).
Uninstall tensorflow and reinstall with python3 -m pip install pathToWheel.whl
Or build yourself from source.
* For OSX, when exporting Heatmap grid to jpeg, a screenshot of the entire screen is taken instead of the specific window.
# Uninstallation:
* Either use the uninstallation script "Uninstallation.py" if you used the Setup.py script during installation
* or simply delete the folders containing the program and the python virtual environment.
# DOCKER:
A Dockerfile is included. To generate the container go to the directory containing the file Dockerfile then type:
sudo docker build -t ami_image_analysis_XXXX . (replace XXXX to your needs)
to start the container (linux):
sudo docker container run \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$DISPLAY \
-v /path/to/USB/:/home/LCPB/USB \
--rm \
-it ami_image_analysis_XXXX
to start the container (OSX):
Install XQuartz. Restart OS.
In XQuartz: Check the option: XQuartz -> Preferences -> Security -> "Allow connections from network clients"
Run in terminal:
IP=$(ifconfig en0 | grep inet | awk '$1=="inet" {print $2}')
xhost +
docker container run \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-e DISPLAY=$IP:0 \
-v -v /path/to/USB/:/home/LCPB/USB \
--rm \
-it ami_image_analysis_XXXX