Giter Club home page Giter Club logo

deepbump's Introduction

DeepBump

DeepBump

DeepBump is a machine-learning driven tool to generate normal & height maps from single pictures. See this blog post for an introduction.

Installation

  1. Download DeepBump as a ZIP.

  2. In Blender, go to Edit -> Preferences -> Add-ons -> Install and select the downloaded ZIP file. Then enable the add-on.

  3. In the add-on preference, click the 'Install dependencies' button (this requires an internet connection and might take a while). In case of error, try running Blender as administrator for this step.

By installing those dependencies, be aware of Microsoft conditions. This add-on use available APIs to disable telemetry.

Usage

Check the blog post first video.

In the Shader Editor, in the right panel under the DeepBump tab:

Color (albedo) → Normals : Select a color image node and click Generate Normal Map.

Normals → Height (displacement) : Select the generated normal map image node and click Generate Height Map.

Normals → Curvature : Select the generated normal map image node and click Generate Curvature Map.

For command-line usage, see cli.md.

License

This repo is under the GPL license. The training code is currently not available.

deepbump's People

Contributors

hugotini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

deepbump's Issues

Can't delete or use the addon

Hi and thanks for making your addon.
i am having issues with using it and deleting the addon, so i can reinstall.
Screenshot 2023-09-20 165752
what can i do to fix?
Thanks alot!

Support generating Roughness maps

Other programs with a similar scope support this as well, and since most of the time you need a roughness texture, but only have a diffuse texture, this would help a lot.

Suggestion: UV-aware

BoroCG's video raises an interesting point about the challenges with UVs. Not sure how/if it is doable yet, but if the model was somehow "UV-aware" it might be able to do better on objects with very fragmented UV-maps

Color Management Issue

DeepBump (v4) doesn't work if you run a different color management config. In my case I'm using AgX config from EaryChow.

I'm getting this error:
Ki724DLDnR

I'm not sure if this is possible, but it would be great if you could use color roles instead of explicit "Non-Color" color setting. This way what color config a users uses won't matter as long as the config is properly setup.

Fresh 3.5 install, add-on v7 - Still not showing in sidebar within shading module

Hi Hugo,

I've read through the prior issues opened by others and seem to be having the same problem: Specifically, that the add-on and dependencies are installed, but the tool does not show up in the sidebar. Details:

Add-on version: V7
Operating System: MacOS 12.3
Blender version: 3.5
Blender installation method: Manual; Downloaded and installed .dmg from Blender website (fresh install)
Blender error logs: Only thing in the logs was the following:

Modules Installed (DeepBump-7) from '/Users/mikesmall/Downloads/DeepBump-7.zip' into '/Users/mikesmall/Library/Application Support/Blender/3.5/scripts/addons'

Blender console logs (start Blender from a terminal):

macbook-pro-2:MacOS mikesmall$ ./Blender
Read prefs: /Users/mikesmall/Library/Application Support/Blender/3.5/config/userpref.blend
Device with name Apple M1 Pro supports metal minimum requirements
METAL API - DETECTED GPU: Apple M1 Pro
Reloading external rigs...
Reloading external metarigs...
DEBUG:BlenderGIS-master.core.checkdeps:GDAL Python binding unavailable
DEBUG:BlenderGIS-master.core.checkdeps:PyProj unavailable
DEBUG:BlenderGIS-master.core.checkdeps:Pillow unavailable
DEBUG:BlenderGIS-master.core.checkdeps:ImageIO Freeimage plugin available
addon_utils.disable: DeepBump-7 not disabled
Modules Installed (DeepBump-7) from '/Users/mikesmall/Downloads/DeepBump-7.zip' into '/Users/mikesmall/Library/Application Support/Blender/3.5/scripts/addons'

For windows, whereas Blender is running as admin or not: N/A; On MacOS
Description of where the error occurs: There is no error presented in Blender, nor in terminal
Any other information that could be relevant: One thing of note: The first time I installed the add-on in Blender, I think had to click the button to install the dependencies. After I removed the add-on and tried to reinstall in the same manner, the window indicated that the dependencies were already installed (even though I hadn't clicked the install dependencies button)

Thanks in advance for your help - and for producing an awesome add-on!

Update for 3.1?

Hi, Awesome work with this very powerful addon. Any chance for an update for 3.1?

Thanks for making this available for free to other artists.

Cheers,

AttributeError: 'Context' object has no attribute 'active_node'. Did you mean: 'active_bone'?

When I activate discombobulator on just a regular, stock cube object and execute it (I don't think this is specific to that operator, it's just where I noticed it and what I use to reproduce it), DeepBump give me this error in the logs:

Python: Traceback (most recent call last):
  File "{BLENDER_PATH}\blender-4.0.2-windows-x64\4.0\scripts\addons\DeepBump-7\__init__.py", line 133, in poll
    if context.active_node is not None :
AttributeError: 'Context' object has no attribute 'active_node'. Did you mean: 'active_bone'?

It's actually at lines 133, 211, 277 in the DeepBump init.py file, everywhere a classmethod checks for None on the active_node attribute on the context. I'm not quite certain why the context doesn't have it in this case or I would have just fixed it and submitted a PR for this instead.

OS: Windows 10
Blender Version: 4.0.2

ModuleNotFoundError after installing

Downloaded and installed v5.1, but while enabling the addon in preference, I encounter this error :

Traceback (most recent call last):
.\Blender 3.4\3.4\scripts\modules\addons_utils.py, line 333, in enable mod = import(module_name)
ModuleNotFoundError : No module named 'DeepBump-5'

Might be a Blender error or some error in the script.
Any help would be appreciated.
Thanks.

Dependency fail on blender 3.4 for ubuntu 22.04.

Command '['/snap/blender/3132/3.4/python/bin/python3.10', '-m', 'pip', 'install', 'onnxruntime']' returned non-zero exit status 1.
image

Been stuck here for a while... is there a way to use the terminal to install them like in dream textures...though i have tried to open the deepmap_master file on terminal and install onnxruntime there but to no avail.

can't install dependencies

Hello,
blender 3.4.
Can't install dependencies (even in administrator Blender startup) because of this error:
Command '['C:\\Program Files\\WindowsApps\\BlenderFoundation.Blender_3.4.0.0_x64__ppwjx1n5r4v9t\\Blender\\3.4\\python\\bin\\python.exe', '-m', 'pip', 'install', 'onnxruntime']' returned non-zero exit status 1.
Please help)

No documentation on removal/uninstallation

Hey there!
My laptop is a bit old and I just happened to try out DeepBump on it for the first time as it was the only pc I had in hand.
I am back to the office and have access to my desktop and installed it there already.
I wanted to clean up some space on the laptop and I'm not sure if removing the addon the normal way does remove everything it has installed.

Just wanted to know:

  • what are these "Dependencies" the addon installs?
  • where are these being installed by the addon?
  • how do I get to remove those?
  • please, this info should be in the docs imo...

Traceback error when attempting to generate normal map

Python: Traceback (most recent call last):
File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\DeepBump-7_init_.py", line 162, in execute
output_img = module_color_to_normals.apply(input_img, OVERLAP, self.progress_print)
File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\DeepBump-7\module_color_to_normals.py", line 36, in apply
ort_session = ort.InferenceSession(addon_path + "/deepbump256.onnx")
File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\DeepBump-7\onnxruntime\capi\onnxruntime_inference_collection.py", line 432, in init
raise e
File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\DeepBump-7\onnxruntime\capi\onnxruntime_inference_collection.py", line 419, in init
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "C:\Users\USER\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\DeepBump-7\onnxruntime\capi\onnxruntime_inference_collection.py", line 451, in _create_inference_session
raise ValueError(
ValueError: This ORT build has ['AzureExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['AzureExecutionProvider', 'CPUExecutionProvider'], ...)

Dynamic axes

Hi! First of all: ty for good model!
Maybe you got variant with dynamic height/width axes?

P.S: Which network you used for training? Tried pix2pix and CycleGAN for roughness but results is pretty bad.

Addon not showing up in toolbar

Its installed and enabled but cant actually use it because its not available in the addon bar (next to "item, "tool", "view")

Dependancy fail

When I installed the addon the other day, when you released v6, it fetched the dependencies fine. Everything installed fine. Everything was great.
Since then Ive updated to the latest blender v3.4.1 daily and tried to reinstall the addon and now the fetching of dependencies are failing

blender_173cKbDdMe

DeepBump as Command-Line Program

Hey HugoTini,
on your blog post about DeepBump it is stated that 'This tool is available both as a Blender add-on and as a command-line program.'

Unfortunately I was unable to find any further information about the 'command-line program' anywhere. All repository content seems to be the blender add-on only. Can you give any hints about how to use DeepBump without blender? Or is that just not easily possible right now?

Thank you very much!

onnx / ORT 1.9 Error

Hi, I would love to use your addon, but unfortunately i always get the same error.
I have tried running Blender as admin, installing Blender, tried different versions of blender (3.4 and 3.6.2) and deepbump (v7 and v6) but somehow i always get the error:

I dont know much about python and google wasnt able to help me.
Am I doing something wrong? How can i fix this?
Thanks for your help! :)

Screenshot (1)

Problem blender 3.4

Does anyone know how to fix the dependency problem? I installed the latest version 6.0 of the addon in my blender 3.4, but I was not successful at all. Nothing about the addon appeared in blender. Even running as administrator and managing to install the dependencies.

Suggestion: Albedo Maps

I wonder if you can use a similar technique to simultaneously generate an albedo map to match?

dependencies don't install on blender 3.5

Command '['C:\Program Files\Blender Foundation\Blender 3.5\3.5\python\bin\python.exe', '-m', 'pip', 'install', 'onnxruntime']' returned non-zero exit status 1.
It seems I'm the only one having the issue.

Error when generating a normal map

I'm getting this error when I try to generate a normal map.

Python: Traceback (most recent call last): File "C:\Users\Piero\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\DeepBump-4\__init__.py", line 151, in execute output_img = module_color_to_normals.apply(input_img, OVERLAP, self.progress_print) File "C:\Users\Piero\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\DeepBump-4\module_color_to_normals.py", line 25, in apply tiles, paddings = utils_inference.tiles_split( File "C:\Users\Piero\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\DeepBump-4\utils_inference.py", line 44, in tiles_split img = pad(img, pad_left, pad_right, pad_top, pad_bottom) File "C:\Users\Piero\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\DeepBump-4\utils_inference.py", line 5, in pad return np.pad(img, ((0, 0), (top, bottom), (left, right)), mode='wrap') File "<__array_function__ internals>", line 180, in pad File "C:\Program Files\Blender Foundation\Blender 3.4\3.4\python\lib\site-packages\numpy\lib\arraypad.py", line 814, in pad raise ValueError( ValueError: can't extend empty axis 1 using modes other than 'constant' or 'empty'

I'm using Blender 3.4.1
It worked before.

Edit: never mind, now it's working fine.
The texture for some reason wasn't loading properly. After I relinked to the correct path, I was able to generate the normal map as expected.

Cannot generate normal map

hi all, i got this problem:

Python: Traceback (most recent call last):
  File "C:\Users\giosu\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\DeepBump-master\__init__.py", line 162, in execute
    output_img = module_color_to_normals.apply(input_img, OVERLAP, self.progress_print)
  File "C:\Users\giosu\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\DeepBump-master\module_color_to_normals.py", line 36, in apply
    ort_session = ort.InferenceSession(addon_path + "/deepbump256.onnx")
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.6\python\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 432, in __init__
    raise e
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.6\python\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 419, in __init__
    self._create_inference_session(providers, provider_options, disabled_optimizers)
  File "C:\Program Files (x86)\Steam\steamapps\common\Blender\3.6\python\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py", line 451, in _create_inference_session
    raise ValueError(
ValueError: This ORT build has ['AzureExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['AzureExecutionProvider', 'CPUExecutionProvider'], ...)

i installed the addon on windows 11
blender version 3.6
i installed the dependencies but the addon give me this error whenever i try to create a normal map

Suggestion: ambient occlusion

The bake of ambient occlusion textures can be very time consuming, yet Blender itself make possible to turn a normal map texture into ambient occlusion without spending any rendering time, that it's done by using the Compositor nodes, so I wonder if it's possible to make that step into a click shortcut inside DeepBump's interface.

Screenshot_1951
Screenshot_1950

Bledner 3.5 error (generate normal map)

bpy.context.scene.deep_bump_tool.colortonormals_tiles_overlap_enum = 'SMALL'
Python: --- Logging error ---
Traceback (most recent call last):
File "/Applications/Blender3.5.app/Contents/Resources/3.5/python/lib/python3.10/logging/handlers.py", line 74, in emit
self.doRollover()
File "/Applications/Blender3.5.app/Contents/Resources/3.5/python/lib/python3.10/logging/handlers.py", line 433, in doRollover
if os.path.exists(dfn):
File "/Applications/Blender3.5.app/Contents/Resources/3.5/python/lib/python3.10/genericpath.py", line 19, in exists
os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
Call stack:
File "/Users/cdy/Library/Application Support/Blender/3.5/scripts/addons/AliceLG/init.py", line 78, in log_exhook
LookingGlassAddonLogger.critical("An unhandled error occured. Here is the traceback:\n", exc_info=(exc_type, exc_value, exc_traceback))
Message: 'An unhandled error occured. Here is the traceback:\n'
Arguments: ()
Traceback (most recent call last):
File "/Users/cdy/Library/Application Support/Blender/3.5/scripts/addons/DeepBump-7/init.py", line 162, in execute
output_img = module_color_to_normals.apply(input_img, OVERLAP, self.progress_print)
File "/Users/cdy/Library/Application Support/Blender/3.5/scripts/addons/DeepBump-7/module_color_to_normals.py", line 36, in apply
ort_session = ort.InferenceSession(addon_path + "/deepbump256.onnx")
File "/Users/cdy/Library/Application Support/Blender/3.5/scripts/addons/DeepBump-7/onnxruntime/capi/onnxruntime_inference_collection.py", line 432, in init
raise e
File "/Users/cdy/Library/Application Support/Blender/3.5/scripts/addons/DeepBump-7/onnxruntime/capi/onnxruntime_inference_collection.py", line 419, in init
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "/Users/cdy/Library/Application Support/Blender/3.5/scripts/addons/DeepBump-7/onnxruntime/capi/onnxruntime_inference_collection.py", line 451, in _create_inference_session
raise ValueError(
ValueError: This ORT build has ['AzureExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['AzureExecutionProvider', 'CPUExecutionProvider'], ...)
Python: --- Logging error ---
Traceback (most recent call last):
File "/Applications/Blender3.5.app/Contents/Resources/3.5/python/lib/python3.10/logging/handlers.py", line 74, in emit
self.doRollover()
File "/Applications/Blender3.5.app/Contents/Resources/3.5/python/lib/python3.10/logging/handlers.py", line 433, in doRollover
if os.path.exists(dfn):
File "/Applications/Blender3.5.app/Contents/Resources/3.5/python/lib/python3.10/genericpath.py", line 19, in exists
os.stat(path)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
Call stack:
File "/Users/cdy/Library/Application Support/Blender/3.5/scripts/addons/AliceLG/init.py", line 78, in log_exhook
LookingGlassAddonLogger.critical("An unhandled error occured. Here is the traceback:\n", exc_info=(exc_type, exc_value, exc_traceback))
Message: 'An unhandled error occured. Here is the traceback:\n'
Arguments: ()
Traceback (most recent call last):
File "/Users/cdy/Library/Application Support/Blender/3.5/scripts/addons/DeepBump-7/init.py", line 162, in execute
output_img = module_color_to_normals.apply(input_img, OVERLAP, self.progress_print)
File "/Users/cdy/Library/Application Support/Blender/3.5/scripts/addons/DeepBump-7/module_color_to_normals.py", line 36, in apply
ort_session = ort.InferenceSession(addon_path + "/deepbump256.onnx")
File "/Users/cdy/Library/Application Support/Blender/3.5/scripts/addons/DeepBump-7/onnxruntime/capi/onnxruntime_inference_collection.py", line 432, in init
raise e
File "/Users/cdy/Library/Application Support/Blender/3.5/scripts/addons/DeepBump-7/onnxruntime/capi/onnxruntime_inference_collection.py", line 419, in init
self._create_inference_session(providers, provider_options, disabled_optimizers)
File "/Users/cdy/Library/Application Support/Blender/3.5/scripts/addons/DeepBump-7/onnxruntime/capi/onnxruntime_inference_collection.py", line 451, in _create_inference_session
raise ValueError(
ValueError: This ORT build has ['AzureExecutionProvider', 'CPUExecutionProvider'] enabled. Since ORT 1.9, you are required to explicitly set the providers parameter when instantiating InferenceSession. For example, onnxruntime.InferenceSession(..., providers=['AzureExecutionProvider', 'CPUExecutionProvider'], ...)

Error when installing dependencies

When I try to install the dependencies, it loads for a second and then gives me this error:
Command '['C:\Program Files\Blender Foundation\Blender 3.2\3.2\python\bin\python.EXE', '-m', 'pip', 'install', 'onnxruntime']' returned non-zero exit status 1.

I can't find any documentation or anyone else talking about this error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.