StyleGAN AI generated images

hahaha it’s consistently surprising to me how many math/CS nerds are on this forum. i’m finishing up an MS in math in the spring! i haven’t done anything serious with ML though, besides playing around with BigGAN and styleGAN a couple years ago when they were the new hotness. Got any paper recs for this operator sequence business? I haven’t heard of it before.

Alright, I have massively increased my potential dataset. I spent several hours using a gallery ripper, gallery-dl, to download art from Deviant Art, Twitter, Exhentai and Pixiv from basically every artist I could find that does primarily humanish fats (nothing against furry, just would muddy up the dataset even more than I already am). I have ~18,000+ images downloaded that I need to process. Admittedly ~50% of these images will end up getting tossed due to either being irrelevant, monochormatic or various other reasons.

One thing I need help with is both the automatic and manual sorting of all these images. I should be able to programmatically remove monochromatic images by doing something like “if image has <x unique colors then delete” but I’m not sure how to do that. ImageMagick has an Identify command which tells how many unique colors images have but I’m not sure how to conditionally delete things based off of it. Similarly images that are <256 px would have to be deleted.

If any of you have ideas on how to do that I would appreciate it, the dataset is far too large to do it manually.

After I do all that, I can use the AI AniSeg I used before to do the majority of the cropping, though it does struggle with larger bodies. Then I’m not sure how I am going to process all the images to make sure they look reasonable for the dataset. It would be a large undertaking to do it solo but idk how I could even attempt to crowdsource checking the images.

If anyone has suggestions on how to deal with this large of a dataset I’m all ears.

I don’t know how you would sort out the images with ImageMagic but couldn’t you do something like if unique colors < x then name it bad_filename, else name it good_filename and something similar with resolution?

crowdsourcing seems simple to me. just asking people to volunteer and then splitting the image set between them and give them some examples of what is good and what is bad. then they can sort there images in good, bad and unsure piles and send them back. if someone doesn’t do there part you can just send that part of the set to someone else (assuming a volunteer is done with there part or a new one showed up)

I don’t have any experience with this stuff though so I wouldn’t be surprised if I overlooked something

1 Like

Please do so, I already have the dataset but TADNE was trained on a modified StyleGAN2 that transfer learning using a vanilla StyleGAN2 will not work. I’m just a noob that only knows how to train, I don’t have the expertise in modifying the architecture itself.

If you are on a Unix like and you can script something to test a picture then something like:

find -type f -name *.png -exec whatever-the-test-is {} \; -delete

should do the job. Use -print instead of -delete until you are absolutely sure it’s working. And if you are on windows then install cygwin and do the above.

1 Like

Found out the place I have been getting all my information also has information on how to clean up the data Here. Looks like you were basically right with what you posted. So can I just paste that entire bit of code into the cygwin command line thing or do I need to make a file and run the file? It been a few years since I last touched anything Unix related.

In other news, after several hours ripping entire galleries, I have ~22 gigs worth of files, 21,793 different files after removing dupes to work through. Hopefully at least half of them worth keeping.

You can do those things from the command line one at a time (the last one is probably worth putting in a script, if only so you can more easily edit the deleteBW() function). As presented though, with the comments, it looks as though it’s supposed to be in one single shell script. It’s not much more effort to do it that way and at least it will be on-hand should you need to do it again.

Just be aware that your home directory in cygwin is not your windows user directory. You’ll find that under /cygdrive/c/Users or similar.

I’ll post my Google Colab once I fix it up a bit. I forgot what all changes I’ve made so I’ll have to go through and make sure I know which things are which.

In other news, was cleaning up the dataset. Went from ~24,000 images to ~9,000 images after removing all the duplicates, irrelevant or otherwise unfitting images I could. Was running the AniSeg thing on the dataset to get the crops overnight but it crashed so I’ll have to run it in chunks. After it all said and done, I should have ~12,000 images between the current dataset and the old one after I remove all the duplicates and such. That will be more than 10 times the size of the original set so I’m hopeful things will work better.

2 Likes

Well I’m stuck at a standstill on this project. I made a fancy new dataset with a bunch of images but now whenever I try to do training, after an iteration or 2 it gives this error.

Been trying to diagnose it off and on for a few days but so far nothing seems to help. It has to be an issue with the dataset because the old dataset still seems to work fine. I’ve been trying to find if there somehow a corrupted .jpg or something that is causing it but so far I haven’t been able to find anything.

So unless someone can figure out the issue, I’m going to take a break from this project because I’m just banging my head against a wall at this point. If you want to use my Jank ass colab for anime training you can find it here. Be warned, it a pretty big mess right now.

If you want to see if you can figure out what wrong with my dataset, you can find it here. Please note that I was just stealing images wholesale from various sources and didn’t spend too much time cleaning it up so there still plenty of bad crops and some of the content might be distasteful. Likewise I had a sickness for the thickness when I made the set so it probably actually useless for training because it too fat but I figured I can always trim the fat (heh) later.

I haven’t had time to look at this myself, but I wonder if something like this could be used for Starbound Big Fatties to simplify the process of adapting new clothes & armors to be compatible with BF?

1 Like

So, the thing with meta-learning is that you gotta be really creative with it, because you usually need to model the entire system specifically for the type of network underneath it, and what exactly you are trying to achieve with it.

There is a lot of research out there about meta-parameter optimization(that is when you make the meta-network find the parameters that work best for the underlying network) exactly because it is such a generic task, but whenever you start making anything more specific(such as what I suggested we do up there with the operator thing), academic resources start drying up.

So yeah, right now this is something you really need to familiar with ML algorithms so that you can have the insight to say “hmmmm… why am I doing this by hand, can’t I apply x method here and have a neural net do that for me?”

And just to be clear, I never worked with meta-learning with images before. What I suggested is just something I thought off the top of my head. I’ve worked regular ML for images before, but that wasn’t even my focus in college. My thesis was actually on Natural Language Processing.

I could refer you to some review papers on meta-learning itself, if you want. Would that do?

I do suggest you do this via crowdsourcing, yes.

Datasets in data science are really important, and we always go with human made ones if we can. It is a really bothersome process, but that is also the only way to guarantee they are good.

This could be a cool project for this community.

Like, we already kinda already browse through a few hundred images when we go out for a fap anyway, right? We could as well make something useful out of it.

I’m not sure how we would organize this. As you’ve seen I’m not around here all that often :sweat_smile: so maybe someone who is here more often could work this out better, but I do think this is a really cool idea.

Btw, I’d still suggest we focus on WG sequences. I think they would be that much easier to work with, especially for what we are trying to do. If we want to learn how to fatten up an image, and not just make a so-so mix of already existing ones, I think looking at images in which the same character in a similar pose fattens up is the way to go.

P.S.: Just saw your other post

It does seem like something got corrupted, but since it only comes up after a few iterations it might actually be one of the intermediate convolutions Tensorflow uses. I’d have to look further into it, and I am not sure I’d have the time.

Btw, an easy way to look into this is to do a quick segmentation of your dataset. Split it in two, run the training with A then with B, see which one gives out the error, then divide again with the one with the error. Kinda like the old merge sort we learned waaaay back in algorithms 101. If you start getting the error for both sides a lot, that means the problem is probably in the programming, not the dataset.

Also, hope you are not too disilussioned with the cause. Because this is a really cool project. Why don’t we focus more on creating the crowdfunded dataset for a bit, then go back into it with a fresher, less banged up head?

It seem you already have an idea of how to do this!

Sometimes what seems simple to some is hard for others!

So, if you could coordinate this effort, it would be awesome, dude.

I’d be up for that. I would just need to taught what would be good a good set for this project first

I could refer you to some review papers on meta-learning itself, if you want. Would that do?

I’d certainly appreciate it, if it isn’t too much trouble.

Took a bit of a break from working on this because I still can’t figure out what is wrong. I asked how to fix it on a AI discord and they recommended batch converting to another format (didn’t work), ImageMagick to test if they all the correct color space (all are sRGB), a function in the fastAI library called verify images (either I set it up wrong or it didn’t detect anything) or “batch ml script wrapper you could run it for every image and log the failed jobs” (not sure how to to do). So at least for now, project ded.

I don’t think StyleGan would be the best bet for this though you could probably get some ok-ish results with the right setup. Someone else might know a better way to set it up.

Hate to say it but got a bit disillusioned with the cause. Having a super hard time diagnosing the issue which is frustrating because it so close to being ready. The dataset ~90% cleaned up already, just a few rough crops to get rid of. I might give the “Divide the dataset in half to find the error” again but I was having inconsistent results and it very slow to test because it takes ~45 min to crash in some situations. I’m not going to say I’m giving up forever but I’ll probably take a break and go back to 3D modeling a bit.

While I can’t afford to host it like “This Anime Does Not Exist” I’ll certainly share the model I create and explain how to generate images.

this almost has a cosmic horror weight gain feel and I approve of chunky eldritch

1 Like

If you ever need some poor schmuck to clean, sort, or label a dataset, I think I’d be up to volunteer for that.
Edit: It’d also be a pretty good idea to take renders of your own 3d models to use as training data.

Oh no my job!
ps. this is still pretty epic

After a good bit of trial and error, managed to narrow down the dataset to only include working images so I can finally start training again. Bad news is that so far it looks like it has a lot of the same issues as the smaller dataset (stuff like messed up eyes and such, though not to the same degree so far). I’ll probably have to look into other settings to tweak such as the learning rate.

Edit:

After training for a good while, the results are okish. Eyes faces and arms are still messed up and there are a lot of fat eldritch abominations but there are some decent enough results (if you look at a distance). I’ll probably let it keep training overnight and see if conditions improve.

2 Likes