Skip to content

Artificial intelligence reveals environmental constraints on colour diversity in insects, Nature Communications (2019)

License

Notifications You must be signed in to change notification settings

twcmchang/colorful-moth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Colorful Moth

license


Moth Segmentation

This part contains the details of background-removal and 5-body-part segmentation processes of moth specimen images from TESRI(Taiwan Endemic Species Research Institute).

Usage

### pipenv
$ cd /to/working/directory/
$ pipenv sync
$ pipenv shell
  
### get model
$ bash get_models.sh


### train - unsupvised
$ python3 Unsup_train.py --XX_DIR=/path/to/image --SAVEDIR=/path/to/save/ --minLabels=/minimum/number/of/labels/ --gpu='gpu_id'

### train - supervised
$ python3 Sup_train.py --XX_DIR=/path/to/image/ --YY_DIR=/path/to/groundtruth/ --SAVEDIR=/path/to/save/ --num_class= number of output class --gpu='gpu_id'

### predict - background removal
$ python3 Sup_predict_rmbg.py --XX_DIR=/path/to/image --model_dir=/path/to/checkpoint/ --gpu='gpu_id'

### predict - 5-body-part segmentation
$ python3 Sup_predict_5comps.py --XX_DIR=/path/to/image --model_dir=/path/to/checkpoint/ --gpu='gpu_id'

Result Sample

Here we show some sample results of the complete processes, you could find more samples in result_sample The first row of each species are what we've tried to remove background. Then we chose the best one for each moth to segment its 5-body parts. The second row are the 5-body-part result of that moth.

Acknowledgements

This repository reuses code from pytorch-unsupervised-segmentation by kanezaki and Data_Science_Bowl_2018 by RaoulMa. Many thanks to all the contributions!


About

Artificial intelligence reveals environmental constraints on colour diversity in insects, Nature Communications (2019)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages