MVP to detect level of foliage in an image. For each parcel NFT, it does the following:
- Removes haze using the
Single Image Haze Removal Using Dark Channel Prior
created by BLKStone. - Arranges the image color, detecting the trees from the remaining content and returns the percentage of foliage.
- Queries for the current owner of the NFT parcel using getProgramAccounts.
- Calculates the program derived account of the parcel NFT being analyzed using findProgramAddressSync.
- Gets the carbon offset token (COT) account for the parcel owner using getOrCreateTokenBag.
- Submits the value and owner to the program derived account which mints COT directly into the owner's token account.
python -m venv venv
python -m ensurepip --upgrade
pip install -r requirements.txt
source PATH/TO/WORKING/DIRECTORY/foliage-detection/venv/bin/activate
Make sure that you have run the @soliage/token-generator in localhost and have generated a tokens.json file which you have copied over to ./data/tokens.json in this repo. Otherwise, you will get an error "Error: No accounts found for token ."
npm start