Funscript AI Generation - VR (& 2D POV now?) - Join the Discord :)

Hi there,

Thank you for your message.

I should be able to troubleshoot you in 2 to 3 hours in the discord mentioned a few posts above.

Need to go afk for now.

Btw, I was thinking. You could probably use alpha passthrough videos as these already have a mask. Then take a number of common background plates without people in it and place those backgrounds behind the frames from the alpha mask at random. You could fairly easily generate a huge amount of training data this way.

1 Like

@fenderwq : thank you for the coffee! Really appreciate :slight_smile:

Also:

You and I need to talk, haha, I like that :slight_smile:

2 Likes

And a quick shot on an AR video below…

Heatmap:

Report:

Extract:

More details in the discord channel :slight_smile:

Well done k00gar! This is very interesting.
One question though, do you think this would also be usable for non-VR videos?

Hi there and thank you for your message !

That’s a tricky question as of now, as the whole game here for VR POV video consists in detecting and tracking specific body parts frame by frame.

I will try to detail my answer below, but to summarize : yes and no (with a bigger weight for the no). And pardon the long answer…

First, in 2D:

  1. Body parts that are not always visible depending on the camera angle (doggystyle with the woman facing the camera and man behind her for instance).
  2. Body parts are not always aligned in a vertical axis like in POV VR for which is solution is initially designed (doggystyle filmed from sideview for example)

But there could be difference between regular 2D and POV 2D clips…

Please check below for results on regular 2D and POV 2D.

Regular 2D:

Let me illustrate that with the processing of an “oldie” stored for posterity.

Spoiler alert, it’s broken, and seems so even on “scripted parts”, I would need to troubleshoot but unfortunately this is not my top priority right now.

The solution could partly consist in the following approach:

  • Apply a dynamic rotation to the frame to have a vertical alignment of the “penetration” / “interaction with penis”
  • Train a YOLO OBB model like showcased here and work with euclidian distance instead of y-axis differential (I initially worked with distance, but finally retained the y-axis approach for POV VR

POV 2D:

Here an example with Mr Lucky POV / Valerica Steele:

So, in theory it could somehow work for POV scenes at least, but the code is not fine tuned for 2D (yet), therefore the algorithm would sometimes behave very weirdly.

Also, in VR, the female is doing most of the job, the stunt cock moves less often than it would in 2D, and upon quick check up here, I can see I have issues related to the fast movement of the cock.

Why is that? Because the “locked penis box” is not adjusting quickly enough due to an anti-jittering system I set up, but which is too strong in this case, I need to losen it up so we can detect more movements.

Last but not least, I need to lessen the moving average logic depending on the frame rate, as this clip is 30fps when most VR are 60fps.

Not sure if it would help, but here is how I did it using Miniconda, which allows to isolate different Python application (i.e. use different versions of a library for each application):

  1. Install miniconda
  2. Start a miniconda command prompt
    image
  3. Execute (assuming you already cloned VR-Funscript-AI-Generator and copied the model into models folder)
conda create -n VRFunAIGen python=3.11
conda activate VRFunAIGen
pip install numpy opencv-python tqdm ultralytics scipy matplotlib simplification
pip uninstall torch torchvision torchaudio
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
cd <VR-Funscript-AI-Generator folder>
python FSGenerator.py

While executing, you’ll need to say “yes” a few times. The lines “pip uninstall / pip3 install” is to replace the “CPU” version of torch with a “cuda enabled / GPU” version (you might need to install nvidia CUDA stuff for it to works, I’m not sure).

3 Likes

@Zalunda : Would you mind if I add this to the readme of the repo, as is ?

Sure, go ahead.

1 Like

Done, thank you :slight_smile:

Also, not so sure, should this topic belong to Software category or General ?

What would you advise ? And would it be necessary to create a new topic, as I think this one looks like a mess (my fault, definitely)?

Happy to hear from you on this.

I would put it in Software. Motion Tracking Funscript Generator is there (and it has one in “How to” aswell). Maybe when it’s more mature, you could create something in the “How to”, or if you are lucky, someone else might do it for you… :wink:

And yes, I would create a new topic and try to limit it to using the application, fixing problem that people have, etc. You could keep this thread for the experimentation that you are doing and stuff. But I’m not an expert either, my multiple topics for FunscriptToolBox is a bit of a mess too.

Also, to complete my miniconda, after the setup, I usually create a batch file to start the application in the right conda environnement (note: need to update the path):

@echo off
call <PATH_TO_MINICONDA>\miniconda3\condabin\conda activate VRFunAIGen
cd /d "<PATH_TO_SOURCES>\VR-Funscript-AI-Generator"
python FSGenerator.py
pause
2 Likes

Update of Jan. 06th 2025:

Updated GUI and optimized filtering that was eliminating some strokes from collected signal.

1 Like

Just updated the GitHub & Discord with pre and post processing options for generated funscripts.

  • Enable boost : boost up is a boost value for peaks, reduce is a lowering value for lows
  • Enable treshold : 0 threshold = all values below selected value will be mapped to 0, and to 100 for any value above the selected 100 threshold
  • Simplification: strength of the VW simplification algorithm (the more, the less points in funscript in the end). Rounding will round values to the closest multiple of 5 or 10
4 Likes

Hi all, finally I can’t do it.
Yesterday I managed to connect my Keon to Heresphere via “Intiface & Scriptplayer” it was quite fun to use this kind of device, it is correctly synchronized with the videos and powerful enough to move the stroker.
Now having some SBS 4k videos but without scripts, I would like to create scripts with this program of k00gar, but I still can’t run it in Python. I tried python in 64bit, in 32Bit, it’s the same thing: syntax error, syntax error, syntax error… What am I doing wrong ??? It’s simple anyway, but at home it doesn’t want.

Capture05

hi this software is free friend?

You should use cmd not python for the commands

2 Likes

Hi, yes, free.

Still in the making, but a thank you or a ko-fi donation simply makes my day :wink:

Join the Discord if you have any question, suggestion, or feel like collaborating!

Hi Robert,

I am not on windows, and I am basically no expert in anything.

Though, as @fenderwq was trying to suggest, the install commands are supposed to be ran from the cmd / terminal tool.

And you might need to have some git client installed on your machine.

https://gitforwindows.org/ (?)

The rest will mostly be ran from Python.

And you would still need to join the discord to download the models.

Hello, I made some progress, managed to install with difficulty all the dependencies to run the program, and I finally managed to generate a .funscript from a 4K SBS video. I then tested the rendering with my Keon but already on a scene where an actress is from behind and straddles the actor, everything is clearly visible in the scene and there is no movement for the Keon in the .funscript file, on the other hand on other scenes I obtained almost synchronous movements with slight defects at times, but in any case it is starting to work for me. Maybe I should only put 1 model in the models folder, and not all three, I don’t know. It’s the YOLO detection, you have to put the 3 files in the models folder, there is one that I unzipped too. In any case, good luck in improving this promising program, it’s a whole other immersion to be synchronized with the videos and not have to do anything. Thank you