At the w/e I decided to automate GAN (AI Art) image production by witing a simple little script that used the CLI to generate GAN images en-masse. Basically the script just issues the command …
dae generate -name artwork -output art/art000001.jpg
(I rename DeepArtEffectsCLI to dae all the time)
The script just changes the output filename each time so 1st time it’s a 1, next 2 … eventually 10000 so I’ve now got art000001.jpg - art010000.jpg (10,000 files as intended).
OK - are any of them the same?
I’m not checking that manually so another script was called for. This one just calculates a hash of each file (a hash is a very long code like ff31d7aef3c3a427f81f02c0b0eb22b5 that’s generated from the file contents). Make a big list of all the hashes and just check no two hashes are the same and - voila, duplicate image detection is easy.
Zero dupicate images - all is going well.
Now I’m going to give all 10,000 images away to people who play the game (its a puzzle) I’m writing. Basically if you hit some arbitary set of circumstances - e.g. have solved 25 puzzles then you get one GAN all for yourself with a good chance it’s unique (I don’t know how many images you’d need to create to get two that were exactly the same - hopefully it’s stupidly unlikely). I’ll delete the original from my server and you are now the proud owner of a GAN image that (hopefully) nobody else in the world has - not even me
Note - The game is free so there’s no cost to the end user…
Enter the “Russian PC”
While exploring this use of DAE I discovered that my new laptop (it’s really good) is actually slower than the “Russian PC” (see elsewhere in forums for that story). My new machine has a 3060, 8 core / 16 thread Ryzen 9 5900HX and 16Gb Memory. DAE won’t work with the GPU (too new for DAE) so I have to use the CPU version. With that I could churn out about 7 GANs per minute.
I’d set my goal on 10,000 images but that’s going to take a full 24 hours on my new laptop. I’ve still got 22+ hours credit on the “Russian PC” - lets give that one a go… At least I get to use my laptop this way as I can run the Cloud PC client on one of the other (the crap ones) machines - problem solved.
I booted up Russia, installed DAE CLI, my scripts and some other stuff (an FTP client is somewhat essential so I could move everything from Russia to England with ease - don’t wanna stick these in some cloud storage, defeats the plan). Anyway, straight away Russia was slightly faster than my new laptop - this was likely as it’s a server with a lot of memory. This made me wonder - what about Tensorflow? I’d already built a TF 1.15.5 that works on older GPUs (which Russian PC has).
With Tensorflow installed in such a way as to take over the task from the DAE version the Russian GPU gets in on the GAN generation game and boosts the output to 14+ GAN images per minute. 11 hours later I’ve got all 10,000 images - transfer them home and we get back to the bit above…
I’ve still got 11 hours on the Russian PC if I need it (thought it’d just be wasted in light of new laptop). If I need to create more GAN images I’ve got the credit to do another 10,000 or so - if I need a lot more then overnight sessions mean I can get 300k in a month for 7.50 GBP Nahh - this was an experiment with the idea of some little reward for my game and I’ve got that ready to go now so I’m happy…