Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 1.31 KB

README.md

File metadata and controls

21 lines (16 loc) · 1.31 KB

foliage-detection

MVP to detect level of foliage in an image. For each parcel NFT, it does the following:

  1. Removes haze using the Single Image Haze Removal Using Dark Channel Prior created by BLKStone.
  2. Arranges the image color, detecting the trees from the remaining content and returns the percentage of foliage.
  3. Queries for the current owner of the NFT parcel using getProgramAccounts.
  4. Calculates the program derived account of the parcel NFT being analyzed using findProgramAddressSync.
  5. Gets the carbon offset token (COT) account for the parcel owner using getOrCreateTokenBag.
  6. Submits the value and owner to the program derived account which mints COT directly into the owner's token account.

Screenshot 2023-03-10 at 14-12-40 forest_v3 - Jupyter Notebook

Quickstart:

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