项目作者: iExecBlockchainComputing

项目描述 :
iExec decentralized application for distributing the computation of gimp's batch mode image processing.
高级语言: Python
项目地址: git://github.com/iExecBlockchainComputing/gimpfu-cartoon.git
创建时间: 2021-08-18T09:15:41Z
项目社区:https://github.com/iExecBlockchainComputing/gimpfu-cartoon

开源协议:Apache License 2.0

下载


gimpfu-cartoon

Off-chain gimp execution


before



after

This application leverages gimp’s batch mode in order to apply a custom-made effect on a given image. The computational processing can be negociated with iExec workers. The original photo credits go to Aleksandar Pasaric.

Running locally

:warning: For more visually appealing results, use high quality images with a few different colors.

Create your input and output folders, then pass them as a parameters in your docker run :

  1. docker build . --tag gimpfu-cartoon
  2. docker run --rm -v /home/user/iexec_in:/iexec_in -v /home/user/iexec_out:/iexec_out -e IEXEC_IN=/iexec_in -e IEXEC_OUT=/iexec_out gimpfu-cartoon

The application will process all .png and .jpg images found in $IEXEC_IN

The results can be found in $IEXEC_OUT

Running with iExec

This section assumes you have:

  • Configured your wallet
  • Configured your API keys and chain configuration files (chain.json, iexec.json)
  • Deployed your docker image to Docker Hub
  • Deployed your application to iExec

Please refer to the quickstart guide to perform the necessary steps.

Executing in the viviani sidehcain testnet :

  1. iexec app run --watch --input-files <image url 1>,<image url 2> --chain viviani --workerpool <address>

Additional running options can be found here.

You’ll find below a minimalist version of the configuration files :

chain.json
  1. {
  2. "default": "viviani",
  3. "chains": {
  4. "viviani": {
  5. "id": "133"
  6. }
  7. },
  8. "providers": {
  9. "infura": {
  10. "projectId": "<infura_projet_id>",
  11. "projectSecret": "<infura_projet_secret>"
  12. },
  13. "quorum": 1
  14. }
  15. }
iexec.json
  1. {
  2. "app": {
  3. "owner": "<your_ethereum_wallet_address>",
  4. "name": "gimpfu-cartoon",
  5. "type": "DOCKER",
  6. "multiaddr": "registry.hub.docker.com/<docker_username>/<docker_image_name>:<docker_image_version>",
  7. "checksum": "<docker_image_checksum>",
  8. "mrenclave": ""
  9. }
  10. }
Fetching results
  1. iexec task show <task_id> --download my-app-result --chain viviani && unzip my-app-result.zip -d my-app-result

You can also download your results using the iExec explorer.