This repository contains a classification of Brazilian paper money.
You can download the freely available datasets with the provided script (it may take a while):
$ sh app/src/data/download_validation.sh
Python 3.8 or later with all requirements.txt dependencies installed. To install run:
$ python -m pip install -r app/requirements.txt
BanknoteBrazil may be run in any of the following up-to-date verified environments (Python and PyTorch preinstalled):
You can train the network with the train.py
script. For more usage information see this. To train with the default parameters:
$ python app/src/modeling/train_model.py
Also, you can evaluate the model against the validation set
$ python app/src/modeling/evaluate_model.py
To predict the outputs of a trained model using some dataset:
$ python app/src/modeling/predict_model.py --file data/test/2reaisVerso/compressed_20_9551306.jpeg
Build the app Dockerfile:
docker build --pull --rm -f "app/Dockerfile" -t banknotebrazil:latest "app"
Run the app of bankNote:
docker run -p 8080:8080 banknotebrazil:latest
Send send an (base64) image over a POST request:
curl --location --request POST 'http://localhost:8080/2015-03-31/functions/function/invocations' \
--header 'Content-Type: application/json' \
--data-raw '{
"body": "image/jpeg;base64"
}'
This project is currently maintained by João Victor Calvo Fracasso and is for academic research use only. If you have any questions, feel free to contact [email protected].
The codes and the pretrained model in this repository are under the MIT license as specified by the LICENSE file. We use our labeled dataset to train the scratch detection model.