Deep Art Effects Command Line Tool For Batch Processing & Scripting

Can you add the facility for CLI to encode video

Can you add an optional chunk size parameter to the artfilter invocation of CLI

CLI switches work with full DAE (complex command line) but the path is ignored - that’d be another cool fix.

Thanks for feedback. we will add these requests to our feature list.

Can you add a command-line switch to optionally send log messages to stdout (as well as / instead of debug.log)

stdout + stderr get system messages anyway so it’s easy to send them all to stdout, having the debug log in the same stream would be a great help

The instructions are fantastic but where is the Batch Processing command; meaning doing the same thing in Deep Art Effects AI TOOLS > BATCH PROCESSING. What is the command line for this option?

When I use the command line function with an included stylename the process always fails. What am I doing wrong? Here’s the screen print of the command line and the response, the first works, the second does not. How do I fix it to use the included style names?

C:\Windows\system32>"C:\Users\hutch\Downloads\DeepArtEffectsCli-win-1.2.6\DeepArtEffectsCli.exe" abstract -input "D:\My Documents\Images\2020\Bill Mask 2020.jpg"  -output "D:\My Documents\Images\2020\Bill Mask 2020 Aba Abstract 1 b2 s76.jpg" -stylename "C:\Users\hutch\Pictures\Saved Pictures\WKH\Aba abstract 1 b2 s76.jpg" -styleweight 76
rendering...
scaling to original!
waiting for core...
2020-12-06 16:46:54.475613: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
Dec 06, 2020 4:46:54 PM com.deeparteffects.core.e.d a
INFO: Watching files matching [*.model] under C:\Users\hutch\.deeparteffects\assets for changes.
Dec 06, 2020 4:46:54 PM com.deeparteffects.core.e.d run
INFO: Starting file watcher service.
core initialized!
starting to render Bill Mask 2020.jpg with Aba abstract 1 b2 s76.jpg (1 of 1)
loading style...
style loaded...
starting AI...
Image processed!
finished!

C:\Windows\system32>"C:\Users\hutch\Downloads\DeepArtEffectsCli-win-1.2.6\DeepArtEffectsCli.exe" abstract -input "D:\My Documents\Images\2020\Bill Mask 2020.jpg"  -output "D:\My Documents\Images\2020\Bill Mask 2020 Aba Abstract 1.jpg" -stylename "Abstract 1" -styleweight 76
rendering...
scaling to original!
waiting for core...
2020-12-06 16:54:58.535736: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
Dec 06, 2020 4:54:58 PM com.deeparteffects.core.e.d a
INFO: Watching files matching [*.model] under C:\Users\hutch\.deeparteffects\assets for changes.
Dec 06, 2020 4:54:58 PM com.deeparteffects.core.e.d run
INFO: Starting file watcher service.
core initialized!
starting to render Bill Mask 2020.jpg with Abstract 1 (1 of 1)
loading style...
Could not render image with this style... skipping
1 Like

If you want to use a predefined style you have to use the option artfilter not abstract.

Please refer this guide here for more examples:

I am following the instructions to the letter! Why is this failing?
C:\Users\hutch\AppData\Roaming\DeepArtEffects>DeepArtEffectsCli.exe artfilter -input “C:\Users\hutch\Pictures\Saved Pictures\Karlsplatz\Karlsplatz.jpg” -output “C:\Users\hutch\Pictures\Saved Pictures\Karlsplatz” -stylename "Colorful"
The following option is required: [-stylename]
For a help use “DeepArtEffects.exe help” or visit our Forums for a Guide.

You haven’t given the command an output filename - change the command to something like this…

C:\Users\hutch\AppData\Roaming\DeepArtEffects>DeepArtEffectsCli.exe artfilter -input “C:\Users\hutch\Pictures\Saved Pictures\Karlsplatz\Karlsplatz.jpg” -output “C:\Users\hutch\Pictures\Saved Pictures\Karlsplatz\test.jpg” -stylename "Colorful"

See what you meant, I forgot to include the \ after Karlsplatz (e.g. -output “C:\Users\hutch\Pictures\Saved Pictures\Karlsplatz\").

Your example above shows: **
*** Using multiple input images:

For all commands above (artfilter, abstract, vincent, artistic, superresolution, removebackground) it is possible to render multiple images at once!
To utilize this feature you simply have to use directories instead of files for input / output / style parameters:
*** Examples:**
DeepArtEffectsCli.exe artfilter -input "C:/images/" -output "C:/imageoutputs/" -stylename "Colorful"
*** DeepArtEffectsCli.exe artfilter -input "C:/images/" -output "C:/imageoutputs/" -stylename "Colorful, Retro, Epoch"**

The solution does not work. Something is left out of your example and instructions. So, please enlighten me with correcting the following input:
“C:\Users\hutch\AppData\Roaming\DeepArtEffects\DeepArtEffectsCli.exe” artfilter -input “C:\Users\hutch\Pictures\Saved Pictures\Karlsplatz\Karlsplatz.jpg” -output “C:\Users\hutch\Pictures\Saved Pictures\Karlsplatz\” -stylename “Colorful, Retro, Epoch” -extension “jpg”
The following option is required: [-stylename]
For a help use “DeepArtEffects.exe help” or visit our Forums for a Guide.

That failed.

Below I added what is not in your instructions, a filename, as you suggested without file type (e.g. “\Karlsplatz\-”), since -extension is being used, there was no mention of including a file name. Only one file is created. I then added an extension the same results happen (e.g. “\Karlsplatz\-.jpg”). Only one file is created.

Below is the first example from above. I included all the code so you may see what is happening.

“C:\Users\hutch\AppData\Roaming\DeepArtEffects\DeepArtEffectsCli.exe” artfilter -input “C:\Users\hutch\Pictures\Saved Pictures\Karlsplatz\Karlsplatz.jpg” -output “C:\Users\hutch\Pictures\Saved Pictures\Karlsplatz\-” -stylename “Colorful, Retro, Epoch” -extension “jpg”
rendering…
scaling to original!
Styles:
Colorful
Retro
Epoch
waiting for core…
2020-12-15 00:32:28.474061: I tensorflow/core/platform/cpu_feature_guard.cc:140] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
Dec 15, 2020 12:32:29 AM com.deeparteffects.core.e.d a
INFO: Watching files matching [*.model] under C:\Users\hutch.deeparteffects\assets for changes.
Dec 15, 2020 12:32:29 AM com.deeparteffects.core.e.d run
INFO: Starting file watcher service.
core initialized!
starting to render Karlsplatz.jpg with Colorful (1 of 3)
loading style…
Dec 15, 2020 12:32:30 AM com.deeparteffects.core.d.b a
INFO: Add new model ed8e394f-1b90-11e7-afe2-06d95fe194ed.model
style loaded…
finished!
starting to render Karlsplatz.jpg with Retro (2 of 3)
loading style…
Dec 15, 2020 12:46:01 AM com.deeparteffects.core.d.b a
INFO: Add new model c79859dc-1560-11e7-afe2-06d95fe194ed.model
style loaded…
finished!
starting to render Karlsplatz.jpg with Epoch (3 of 3)
loading style…
Dec 15, 2020 12:47:33 AM com.deeparteffects.core.d.b a
INFO: Add new model c7984f92-1560-11e7-afe2-06d95fe194ed.model
style loaded…
finished!

So, what I believe is going on, the instructions are lacking information when using multiple input images. What am I missing here?

Well, it clearly says it’s writing the images out but it’s overwriting each output with the next one

The examples are not mine, they’re by DAE

The processing of directories is a bit hit and miss - removebackground doesn’t work at all ATM for example. I remember getting artfilter to apply one style to all the images in a directory but there’s no command-line way to do one image > multiple styles I’m aware of. The way I got around this limitation was to simply automate writing a batch file.

The GUI batch processing option at least allows you to select an input image then it outputs a version for each style available. They could implement that in cli I guess (that’s up to DAE)

I did start writing something to process multiple files before CLI came out - maybe I’ll look into that again. Someone wants video background compositing so I might get around to it as CLI makes processing multiple files at least possible,

1 Like

Can anyone tell me how to use the “original colors” option?

Use the -originalcolors flag.

1 Like

Cedric answered your question for both within Deep Art Effect and command line.

Below not only answers your question, but may answer other user questions on how to use the command line prompt. The following may prove to be helpful to others.

This article directly addresses using Windows 10 and creating a batch file. To make it easier to follow I am listing explanation in numbered steps.

  1. First, I created a batch file (below) in NOTEPAD and saved the file “DAE Multiple Files.bat” make sure to put the file name in quotes, when saving in Notepad. This saves the file as a batch file and NOT a text file. To run the file, you simply double click the bat file.

  2. Why do I use this method? It saves me time and gives me a reference folder with all the baseline source images and their impact on what I generally take photos of and want to have DAE generate a painted image. Sound confusing, keep reading, hopefully, the following will help you understand what I am doing.

  3. For my source images, I have a higher level folder kept in the Windows USER default Pictures folder. In my case that folder is located “C:\Users\USERNAME\Pictures”.

  4. In that folder, I created a new folder I called, "Saved Pictures". The resulting folder is “C:\Users\USERNAME\Pictures\Saved Pictures”.

  5. In that folder, I keep source images. Known in DAE as stylename.

  6. Generally, I take nature, city, or portraits of people. In their respective folder, I have the baseline photograph; a beach scene, a town square, and a face shot. Known in DAE as input. Their folder names are Beach, City, and Portrait respectively.

  7. When I obtain a new source image, in this case, I modified a Picasso image (see attached) and called it Picasso-mine.png. I saved that image in the Saved Pictures; the stylename folder.

  8. I want to apply the new artwork to the three baseline images. Known in DAE as output. You will note in the bat file, I preceded the file name with an underscore, this is to help me, you may or may not want to use the underscore, it is your call.

  9. From Windows Explorer, in the Saved Pictures folder, right click the DAE Multiple Files.bat file, and select EDIT, and change the output and the stylename file to the name of the new stylename, in this case it is called Picasso-mine.png.

  10. Save the file.

  11. To run the file, right click the DAE Multiple Files.bat file and click OPEN. This will open the Command Prompt file telling you the process of the the conversion. Depending on many factors this can take a few minutes to over an hour. You can work on other things while the file is running. DO NOT CLOSE the file while it is running. When it is done, you will be notified to press enter to continue.

  12. When the program is done, it should save the new stylename DAE file in the respective folders. Now you can open those folders and view the impact of running DAE on your original image.

  13. Doing the above saves a lot of time. I do keep an Excel file with all the stylenames. Depending on what you want to do, you could save the information in a Word or Note file. This way you can sort the file names to make sure you do not make duplicate images.

Hope this helps. Below should also be of use.

DAE Multiple Files.bat file READABLE VERSION:

echo %date% %time%

“C:\Users\USERNAME\AppData\Roaming\DeepArtEffects\DeepArtEffectsCli.exe” abstract
-input “C:\Users\USERNAME\Pictures\Saved Pictures\Beach\Beach.jpg”
-output “C:\Users\USERNAME\Pictures\Saved Pictures\Beach\_Picasso-mine.png
-stylename “C:\Users\USERNAME\Pictures\Saved Pictures\Picasso-mine.png
-originalcolors -styleweight 100

“C:\Users\USERNAME\AppData\Roaming\DeepArtEffects\DeepArtEffectsCli.exe” abstract
-input “C:\Users\USERNAME\Pictures\Saved Pictures\City\City.jpg”
-output “C:\Users\USERNAME\Pictures\Saved Pictures\City\_Picasso-mine.png
-stylename “C:\Users\USERNAME\Pictures\Saved Pictures\Picasso-mine.png
-originalcolors -styleweight 100

“C:\Users\USERNAME\AppData\Roaming\DeepArtEffects\DeepArtEffectsCli.exe” abstract
-input “C:\Users\USERNAME\Pictures\Saved Pictures\Portrait\Portrait.jpg”
-output “C:\Users\USERNAME\Pictures\Saved Pictures\Portrait\_Picasso-mine.png
-stylename “C:\Users\USERNAME\Pictures\Saved Pictures\Picasso-mine.png
-originalcolors -styleweight 100

echo %date% %time%
pause

DAE Multiple Files.bat file (SAVE this version. The above one is for readability purposes only)

echo %date% %time%
“C:\Users\USERNAME\AppData\Roaming\DeepArtEffects\DeepArtEffectsCli.exe” abstract -input “C:\Users\USERNAME\Pictures\Saved Pictures\City\City.jpg” -output “C:\Users\USERNAME\Pictures\Saved Pictures\City_Picasso-mine.png” -stylename “C:\Users\USERNAME\Pictures\Saved Pictures\Picasso-mine.png” -originalcolors -styleweight 100
“C:\Users\USERNAME\AppData\Roaming\DeepArtEffects\DeepArtEffectsCli.exe” abstract -input “C:\Users\USERNAME\Pictures\Saved Pictures\Beach\Beach.jpg” -output “C:\Users\USERNAME\Pictures\Saved Pictures\Beach_Picasso-mine.png” -stylename “C:\Users\USERNAME\Pictures\Saved Pictures\Picasso-mine.png” -originalcolors -styleweight 100
“C:\Users\USERNAME\AppData\Roaming\DeepArtEffects\DeepArtEffectsCli.exe” abstract -input “C:\Users\USERNAME\Pictures\Saved Pictures\Portrait\Portrait.jpg” -output “C:\Users\USERNAME\Pictures\Saved Pictures\Portrait_Picasso-mine.png” -stylename “C:\Users\USERNAME\Pictures\Saved Pictures\Picasso-mine.png” -originalcolors -styleweight 100
echo %date% %time%
pause

ADDENDUM: If you are going to use an ARTFILTER style, the following parameters in BOLD must be changed. In the example below, the artfilter stylename is Pointillism 3.

“C:\Users\USERNAME\AppData\Roaming\DeepArtEffects\DeepArtEffectsCli.exe” artfilter
-input “C:\Users\USERNAME\Pictures\Saved Pictures\Beach\Beach.jpg”
-output “C:\Users\USERNAME\Pictures\Saved Pictures\Beach_Pointillism 3.jpg”
-stylename “Pointillism 3
-originalcolors

Picasso-mine.png

1 Like

Great post, thanks. Keep up the good work

“In the desktop version the artfilter allows you to specify a resolution (normal, high, very high, etc.). However I do not see this as an option in the CLI. I think this could be useful because I preview some of them in the destop program. I could resize them before batching them in the CLI. But maybe it would make sense to add this since it is in the desktop version.”

I just found out this is included in the CLI just not in the documentation up here.

Yes, it is included in the CLI, but was missing in this post. Thank you for the information. The documentation is now updated!

hi,

i have the following error message:
C:\Users\Administrator>DeepArtEffectsCli.exe -version
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by nu.pattern.OpenCV$SharedLoader (file:/C:/Users/Administrator/DeepArtEffectsCli.exe) to field java.lang.ClassLoader.usr_paths
WARNING: Please consider reporting this to the maintainers of nu.pattern.OpenCV$SharedLoader
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Deep Art Effects v. 1.2.7

The batch processing works, but much slower (3-4x slower than the windows version)… and also the artwork result seems to have a problem (different than it should be)…

Thanks for your support.

Tim

That’s been happeneing with CLI forever - I have pointed it out but it’s never been sorted

It doesn’t actually stop DAE working tho so I just ignore it

DAE CLI has an overhead in that every single time you run it it has to start up Java before it can run your command - this does, indeed, make it slower. The thing is that you’re usually doing something repetative if using CLI so adding a few secs to each run is offset by having to manually load and save every image

Swings and Roundabouts…

A new CLI version has been released that now supports colorization and artwork generation.

Hello there, I am new to the community. And I find this discussion very relatable and helpful. It’s great to see such a detailed performance comparison. Optimizing the tool with a multiple batch input file, as you suggested, seems like a solid way to reduce the overhead caused by repeated startups and shutdowns. I noticed the developers are planning to implement this feature, which should help a lot with efficiency.

Thanks for the insights, I am looking forward to the updates.

1 Like