...
 
Commits (13)
...@@ -16,33 +16,75 @@ if [ "$EUID" -ne 0 ] ...@@ -16,33 +16,75 @@ if [ "$EUID" -ne 0 ]
exit exit
fi fi
echo "[PYNOVISAO INSTALLER] Updating apt-get..." read -p "Would you like to install the requirements for python3 usage? [y/n]" -n 1 -r
sudo apt-get -qq update
echo "[PYNOVISAO INSTALLER] Installing prerequisites..."
sudo apt-get -qq -y install libfreetype6-dev tk tk-dev python-pip openjdk-8-jre openjdk-8-jdk weka weka-doc python-tk python-matplotlib
source ~/.bashrc
echo "[PYNOVISAO INSTALLER] Upgrading pip..."
sudo pip install --upgrade pip --quiet
# Numpy must be installed before installing javabridge
echo "[PYNOVISAO INSTALLER] Installing numpy..."
sudo pip install numpy==1.14.5 --quiet
echo "[PYNOVISAO INSTALLER] Installing libraries..."
sudo pip install -r requeriments.txt --quiet
printf "${YELLOW} \n======== WARNING ========\n"
printf "The Keras is necessary so that it is possible to use CNN. It is recommended to install the version for GPU processing (if available) but it is also possible to use CPU processing.\n"
printf "To install the GPU version (tricky) follow the steps at: https://www.tensorflow.org/install/install_linux"
printf "${NC}\n"
read -p "Would you like to install keras CPU libraries? [y/n]" -n 1 -r
echo echo
if [[ $REPLY =~ ^[Yy]$ ]] if [[ $REPLY =~ ^[Yy]$ ]]
then then
echo "[PYNOVISAO INSTALLER] Installing keras libraries..." echo "[PYNOVISAO INSTALLER] Updating apt-get..."
sudo pip install tensorflow sudo apt-get -qq update
sudo pip install keras echo "[PYNOVISAO INSTALLER] Installing prerequisites..."
sudo apt-get -qq -y install libfreetype6-dev tk tk-dev python3-pip openjdk-8-jre openjdk-8-jdk weka weka-doc python3-tk
source ~/.bashrc
#echo "[PYNOVISAO INSTALLER] Upgrading pip3..."
#sudo pip3 install --upgrade pip --quiet
# Numpy must be installed before installing javabridge
echo "[PYNOVISAO INSTALLER] Installing numpy..."
sudo pip3 install numpy --quiet
echo "[PYNOVISAO INSTALLER] Installing libraries..."
sudo pip3 install -r requirements_pip3.txt --quiet
printf "${YELLOW} \n======== WARNING ========\n"
printf "The Keras is necessary so that it is possible to use CNN. It is recommended to install the version for GPU processing (if available) but it is also possible to use CPU processing.\n"
printf "To install the GPU version (tricky) follow the steps at: https://www.tensorflow.org/install/install_linux"
printf "${NC}\n"
read -p "Would you like to install keras CPU libraries? [y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "[PYNOVISAO INSTALLER] Installing keras libraries..."
sudo pip3 install tensorflow
sudo pip3 install keras
fi
echo
printf "${BLUE}[PYNOVISAO INSTALLER] Installation completed for Python 3!${NC}"
echo
fi fi
read -p "Would you like to install the requirements for python2 usage? [y/n]" -n 1 -r
echo echo
printf "${BLUE}[PYNOVISAO INSTALLER] Installation completed!${NC}" if [[ $REPLY =~ ^[Yy]$ ]]
echo then
echo "[PYNOVISAO INSTALLER] Updating apt-get..."
sudo apt-get -qq update
echo "[PYNOVISAO INSTALLER] Installing prerequisites..."
sudo apt-get -qq -y install libfreetype6-dev tk tk-dev python-pip openjdk-8-jre openjdk-8-jdk weka weka-doc python-tk
source ~/.bashrc
#echo "[PYNOVISAO INSTALLER] Upgrading pip3..."
#sudo pip install --upgrade pip --quiet
# Numpy must be installed before installing javabridge
echo "[PYNOVISAO INSTALLER] Installing numpy..."
sudo pip install numpy --quiet
echo "[PYNOVISAO INSTALLER] Installing libraries..."
sudo pip install -r requeriments.txt --quiet
printf "${YELLOW} \n======== WARNING ========\n"
printf "The Keras is necessary so that it is possible to use CNN. It is recommended to install the version for GPU processing (if available) but it is also possible to use CPU processing.\n"
printf "To install the GPU version (tricky) follow the steps at: https://www.tensorflow.org/install/install_linux"
printf "${NC}\n"
read -p "Would you like to install keras CPU libraries? [y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "[PYNOVISAO INSTALLER] Installing keras libraries..."
sudo pip install tensorflow
sudo pip install keras
fi
echo
printf "${BLUE}[PYNOVISAO INSTALLER] Installation completed for Python 2!${NC}"
echo
fi
This diff is collapsed.
...@@ -7,10 +7,10 @@ sympy ...@@ -7,10 +7,10 @@ sympy
nose nose
networkx networkx
scikit-image scikit-image
javabridge==1.0.18 javabridge==1.0.12
python-weka-wrapper python-weka-wrapper
cycler==0.10 cycler==0.10
cython Cython
h5py h5py
scikit-learn==0.20.1 scikit-learn==0.20.1
statistics statistics
......
opencv-python
python-dateutil
matplotlib
scipy
pandas
sympy
nose
networkx
scikit-image
javabridge
python-weka-wrapper
cycler
Cython
h5py
scikit-learn
statistics
pandas_ml
pyxdg
opencv-contrib-python
python-interface
tqdm
sklearn
pyxdg
pascal-voc-writer
psutil
...@@ -1078,11 +1078,11 @@ class Act(object): ...@@ -1078,11 +1078,11 @@ class Act(object):
self.tk.write_log(message) self.tk.write_log(message)
def create_xml(self): def create_xml(self):
''' """
Generate a .XML file, with the file having 'name of the image including its extension'.xml. Generate a .XML file, with the file having 'name of the image including its extension'.xml.
This file will take the current xml object from Pascal_Voc_Writer and finalize it, This file will take the current xml object from Pascal_Voc_Writer and finalize it,
creating the file in the current directory and moving it towards /pynovisao/data/XML. creating the file in the current directory and moving it towards /pynovisao/data/XML.
''' """
self._xml_file.save("{}.xml".format(self._image_name)) self._xml_file.save("{}.xml".format(self._image_name))
current_path=os.getcwd() current_path=os.getcwd()
current_path=current_path[-1::-1] current_path=current_path[-1::-1]
...@@ -1096,10 +1096,10 @@ class Act(object): ...@@ -1096,10 +1096,10 @@ class Act(object):
def run_xml_converter(self): def run_xml_converter(self):
self.tk.write_log("Started mass annotation process, it may take a while...") self.tk.write_log("Started mass annotation process, it may take a while...")
def moveXML(file): #Move the xml files into the 'data/XML' folder def moveXML(file): #Move the xml files into the 'data/XML' folder
''' """
File: string file: string
Name of the original image. Name of the original image.
''' """
current_path=os.getcwd() current_path=os.getcwd()
current_path=current_path[-1::-1] current_path=current_path[-1::-1]
current_path=current_path[3::1] current_path=current_path[3::1]
...@@ -1110,20 +1110,20 @@ class Act(object): ...@@ -1110,20 +1110,20 @@ class Act(object):
shutil.move(os.getcwd()+"/{}.xml".format(file),current_path+"/{}.xml".format(file)) shutil.move(os.getcwd()+"/{}.xml".format(file),current_path+"/{}.xml".format(file))
def arrasteSeg(imgog, imgseg, LinhaOg, ColunaOg, LinhaSeg, ColunaSeg): def arrasteSeg(imgog, imgseg, LinhaOg, ColunaOg, LinhaSeg, ColunaSeg):
''' """
imgog: numpy array imgog: numpy array
Array of the original image. Array of the original image.
imseg: numpy array imseg: numpy array
Array of the segment being searched for. Array of the segment being searched for.
LinhaOg: int LinhaOg: int
Current position in the imgog (X axis). Current position in the imgog (X axis).
LinhaSeg: int LinhaSeg: int
Current position in the imseg (X axis). Current position in the imseg (X axis).
ColunaOg: int ColunaOg: int
Current position in the imgog (Y axis). Current position in the imgog (Y axis).
ColunaSeg: int ColunaSeg: int
Current position in the imseg (Y axis). Current position in the imseg (Y axis).
''' """
#Drags the segment over the original image #Drags the segment over the original image
l = 0 l = 0
while(l <= (LinhaOg - LinhaSeg)): while(l <= (LinhaOg - LinhaSeg)):
...@@ -1148,16 +1148,16 @@ class Act(object): ...@@ -1148,16 +1148,16 @@ class Act(object):
l = l + 1 l = l + 1
def achaSeg(self, pathS, file, pog, arquivos): def achaSeg(self, pathS, file, pog, arquivos):
''' """
pathS: string pathS: string
Filepath to the segments folder. Filepath to the segments folder.
file: string file: string
Name of the original image. Name of the original image.
Pog: string Pog: string
Filepath to original image (file). Filepath to original image (file).
arquivos: string array arquivos: string array
Segments alredy found in a image. Segments alredy found in a image.
''' """
#Reads all segment files in the given folder (pathS) #Reads all segment files in the given folder (pathS)
tottime = 0 tottime = 0
arquivo=os.path.join(pog, file) arquivo=os.path.join(pog, file)
...@@ -1198,12 +1198,12 @@ class Act(object): ...@@ -1198,12 +1198,12 @@ class Act(object):
moveXML(file) moveXML(file)
def achaImg(self, pathS, pathIO): def achaImg(self, pathS, pathIO):
''' '''
pathS: string pathS: string
Filepath to the segments folder. Filepath to the segments folder.
pathIO: string pathIO: string
Filepath to the Original Images folder. Filepath to the Original Images folder.
''' '''
arquivos = [] #Segments alredy found, starts empty arquivos = [] #Segments alredy found, starts empty
thread = [] #Threads created, starts empty. thread = [] #Threads created, starts empty.
#Verifies all original images (files) under the given folder (pathIO) #Verifies all original images (files) under the given folder (pathIO)
......