Skip to content

naturalsolutions/NBSEduWorld

 
 

Repository files navigation


Logo

Dutch Cycling Lifestyle

Develop a happier and healthier street with our cycling lifestyle.
Explore the docs »



Vote for us

📢 We have been nominated for a Webby Award!
The Dutch Cycling Lifestyle AI tool could win a Webby in the category AI, metaverse & experiences - public services and activism
Help us win and vote.



Read more · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Credits
  9. Acknowledgments

About The Project

Background

Nature-based solutions (NBS) are solutions that are inspired and supported by nature, which are cost-effective, simultaneously provide environmental, social and economic benefits and help build resilience. Such solutions bring more, and more diverse, nature and natural features and processes into cities, landscapes and seascapes, through locally adapted, resource-efficient and systemic interventions. Nature-based solutions must therefore benefit biodiversity and support the delivery of a range of ecosystem services.

NBS EduWORLD is a Horizon Europe project at the crossroads between nature-based solutions and education, a forerunner project blending the two topics. The result is a unique consortium bringing together researchers, educators, NBS practitioners, and even sports community members with the common goal of creating engaging and locally relevant educational materials centering the environmental, social, and professional merits of NBS.

Before After

Built with

The tool relies mainly on the technology called Stable Diffusion. This technology allows us to generate images using text prompts on a model that's trained on a lot of images.

This model also allows us to "inpaint" in a certain area of an existing picture. To determine this area we use a segmentation model that detects the road and vehicles in the original images.

Segmentation of unwanted objects

All of this is built in a framework especially for the mentioned technology, called ComfyUI, which is a visual node-based interface for AI image processing. This framework allows us to easily modify the workflow and add new features.

Getting Started

Python Notebook

When you don't have the necessary GPUs in your machine, you can run the python notebook in Google Colab and follow the usage guide from the workflow section.

Open In Colab

Prerequisites for local installation

AMD GPUs (Linux only)

AMD users can install rocm and pytorch with pip if you don't have it already installed, this is the command to install the stable version:

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.7

This is the command to install the nightly with ROCm 6.0 which might have some performance improvements:

pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/rocm6.0

NVIDIA

Nvidia users should install stable pytorch using this command:

pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu121

This is the command to install pytorch nightly instead which might have performance improvements:

pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121

Troubleshooting

If you get the "Torch not compiled with CUDA enabled" error, uninstall torch with:

pip uninstall torch

And install it again with the command above.

Local installation

Clone this repository and run the install.sh script to install the ComfyUI framework in this folder. This script will also install the necessary (recommended) models and nodes for the tool to work with our workflow.

git clone https://github.com/dutchcyclinglifestyle/dutchcyclinglifestyle.git

cd dutchcyclinglifestyle

./install.sh

Usage

Use the run.sh script to start the server. You can also run the server by running python main.py from the ComfyUI directory.

./run.sh

Then drag and drop the original workflow json file into the ComfyUI manager UI or use the Load workflow button on the right side of the UI.

Add your image to the Load Image node and run the workflow. To infer using API, read the example code of ComfyUI for further explanation.

Please note that the first run of the workflow will take a while to download the required Segment Anything models. After the download is complete, you can start using the tool at full speed.

Workflow

original ComfyUI workflow

You can also save the workflow image and drag and drop it into the ComfyUI manager UI to load the workflow.

Roadmap

Contributing

This project is open source and we welcome contributions. Report bugs and feature requests using the issues tab, or request new features by forking the project and creating a pull request.

The best way to contribute is to modify the ComfyUI workflow and add new nodes to the tool and submit a pull request with a new workflow json file in the workflows folder. Installs of the added custom nodes, or new models can be added to the install.sh script.

License

Distributed under the MIT License. See LICENSE.txt for more information.

Contact

[email protected]

Credits

This project is developed by Handpicked Lab (creative technology & backend), IN10 (frontend), HumanKind (concept & urban planning) and the Netherlands Board of Tourism & Conventions (NBTC).

Special thanks to the following people for their contributions:

Acknowledgments

This tool couldn't have been made without the following open source projects:

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 97.9%
  • Shell 2.1%