The aim of this repository is to train a neural network capable of detecting fish from the image dataset of the underwater laboratory OBSEA, linked to the research group SARTI.
The implemented code is based on the Mask R-CNN repository for the detection and segmentation object. Additional information can be found at their website.
-
Virtual environment with Python 3.6.
- Installing virtualenv
py -m pip install --user virtualenv
- Creating a virtual environment
py -m venv /path/to/env
- Activating a virtual environment
.\env\Scripts\activate
- Installing virtualenv
-
pip install -r /path/to/requirements.txt
-
-
Git Clone Mask R-CNN GitHub Repository.
> git clone https://github.com/matterport/Mask_RCNN.git
-
Install Mask R-CNN Library
> cd Mask_RCNN > python setup.py install
S'ha de moure la carpeta mrcnn, que esta dinas de la carpeta intalada mask_rcnn, a l'entorn virtual.
-
Confirm the Library Was Installed
> pip show mask-rcnn
-
-
Download the weights file of Mask R-CNN model here.
-
Install Dataset OBSEA.
> git clone https://github.com/uripratt/OBSEA-dataset/tree/master
OBSEA ├── Tagging_XML └── Tagging_Img
Change the "STEPS_PER_EPOCH" parameter if you will change the original DataSet: Depending on the total number of photos in the dataset, it is necessary to separate approximately 90% for training and 10% to validation the model. In the present case a total of 3366 photos are trained.
STEPS_PER_EPOCH = 3366
Execute train_R_CNN_OBSEA.py
To detect objects it is necessary to run the code Detect_OBSEA_RCNN.py, in this case it has been trained with 10% of the images explained above (also used to validate the model). Therefore, the "STEPS_PER_EPOCH" paramater has to have the same value.
If the user wants to detect with another dataset, the following parameters must be changed:
Explicar més endevant