Skip to content

Commit f6d09ea

Browse files
author
arch
committed
improve doc
1 parent 326907e commit f6d09ea

File tree

23 files changed

+952
-256
lines changed

23 files changed

+952
-256
lines changed

contrib/OpenFunscripter/README.md

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,4 @@
22

33
A hacky lua script to use the python funscript generator script in Open Funscripter.
44

5-
## Installation
6-
7-
1. Download the latest packed Python Funscript Editor from [github release page](https://github.com/michael-mueller-git/Python-Funscript-Editor/releases).
8-
2. Extract the Archiv to an Path without special character or spaces.
9-
3. Copy the `funscript_generator.lua` script to `data/lua` in your OFS directory.
10-
4. Open the `funscript_generator.lua` file and adjust the `Settings.FunscriptGenerator` and `Settings.TmpFile` variable.
11-
- `Settings.FunscriptGenerator`: point to the extracted Python Funscript Editor program
12-
- `Settings.TmpFile`: specifies a temporary file where to store the result (must be a file not a directory!). The file will be overwritten automatically the next time the generator is started!
13-
5. Now launch OFS.
14-
6. Navigate to `View : Special functions : Custom Functions` and select the `funscript_generator.lua` entry. Click the Button `Bind Script` (This may trigger the funscript generator, just ignore it for now).
15-
7. Navigate to `Options : Keys : Dynamic` and insert a shortcut for the funscript generator.
16-
8. Now you can use the shortcut at any position in the video to start the funscript generator.
5+
The [installation instructions](https://github.com/michael-mueller-git/Python-Funscript-Editor/tree/main/docs/app/docs/user-guide/ofs-integration.md) are now included in the documentation.

docs/app/docs/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Python Funscript Editor
2+
3+
A Python program to quickly create prototype algorithms to partially automate the generation of funscripts.
4+
5+
**NOTE:** The program is currently not intended for productive use. But you can do whatever you want with this tool.
6+
7+
## User-Guide
8+
9+
- [Algorithms](user-guide/algorithms/index.md)
10+
- [OFS Integration](user-guide/ofs-integration/index.md)
11+
- [UI](user-guide/ui/index.md)

docs/app/docs/index.md

Lines changed: 4 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -4,73 +4,8 @@ A Python program to quickly create prototype algorithms to partially automate th
44

55
**NOTE:** The program is currently not intended for productive use. But you can do whatever you want with this tool.
66

7-
## UI
7+
## User-Guide
88

9-
The UI use an embedded mpv video player and matplotlib to draw the actions timeseries at the bottom.
10-
11-
### Keyboard Shortcuts
12-
13-
| Key | Function |
14-
| -------------------- | --------------------------- |
15-
| P | Pause / Playback |
16-
| . | Next frame |
17-
| , | Previous frame |
18-
| [ | Decrease speed |
19-
| ] | Increase speed |
20-
| Ctrl + Shift + Left | Previous Action Point |
21-
| Ctrl + Shift + Right | Next Action Point |
22-
| Shift + L | Loop Video |
23-
| W | Move Stroke Indicator Up |
24-
| A | Move Stroke Indicator Left |
25-
| S | Move Stroke Indicator Down |
26-
| D | Move Stroke Indicator Right |
27-
| Ctrl + I | Invert Stroke Indicator |
28-
| Ctrl + Plus | Increase Stroke Indicator |
29-
| Ctrl + Minus | Decrease Stroke Indicator |
30-
| Gtrl + G | Start Funscript Generator |
31-
| Shift + Pos1 | First Action Point |
32-
| Shift + End | Last Action Point |
33-
| Pos1 | Jump to Video Start |
34-
| End | Jump to Video End |
35-
| 0 | Add Action Point at 0% |
36-
| 1 | Add Action Point at 10% |
37-
| 2 | Add Action Point at 20% |
38-
| 3 | Add Action Point at 30% |
39-
| 4 | Add Action Point at 40% |
40-
| 5 | Add Action Point at 50% |
41-
| 6 | Add Action Point at 60% |
42-
| 7 | Add Action Point at 70% |
43-
| 8 | Add Action Point at 80% |
44-
| 9 | Add Action Point at 90% |
45-
46-
## Algorithms
47-
48-
### Create Funscript Action using OpenCV Tracker
49-
50-
Idea: By using [OpenCV Tracker](https://learnopencv.com/object-tracking-using-opencv-cpp-python/), we can determine the relative movements in a static camera setup and map them into Funscript actions using simple signal processing.
51-
52-
The Algorithm is implemented for 3D Side-By-Side VR Videos. Some parameter are currently hard coded. It should be possible to expand the functionality to 2D Videos by changing the code, with the following limitations.
53-
54-
#### Limitations
55-
56-
- Static camera setup
57-
- Fixed reference point of relative movement in video required
58-
- No video cuts within a tracking sequence allowed
59-
- No change of position of the performers
60-
- Features in the video which are visible in all following frames of the tracking sequence required.
61-
62-
#### Process
63-
64-
1. Selection of the features for the Woman and Men in the video, which should be tracked.
65-
2. Predict the feature positions in the following video frames by OpenCV Tracker.
66-
3. Calculate the difference between the predicted tracking boxes.
67-
4. Map the relative difference to an absolute difference score by user input.
68-
5. Filter all local min and max points to get the final action positions for the Funscript.
69-
70-
#### Improvements
71-
72-
- You can change the OpenCV tracker in the source code which predicts the position. OpenCV offers several trackers which differ in prediction accuracy and processing speed. See also [OpenCV Tracker](https://learnopencv.com/object-tracking-using-opencv-cpp-python/).
73-
74-
- You can set the number of frames that are interpolated by the `skip_frames` parameter. 0 means that the OpenCV tracker delivers a prediction for each frame. This is slower but more accurate. Or if greater than zero, the individual frames are skipped and then the tracking boxes are interpolated, which increases the processing speed but decreases the accuracy. I have set the value to 1, i.e. every 2nd frame is skipped and interpolated. Which provides a good mix of accuracy and speed.
75-
76-
- It is recommended to use a low resolution video e.g. 4K for generating the funscript actions, as the processing speed is higher.
9+
- [Algorithms](user-guide/algorithms/index.html)
10+
- [OFS Integration](user-guide/ofs-integration/index.html)
11+
- [UI](user-guide/ui/index.html)
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Algorithms
2+
3+
## Create Funscript Action using OpenCV Tracker
4+
5+
Idea: By using [OpenCV Tracker](https://learnopencv.com/object-tracking-using-opencv-cpp-python/), we can determine the relative movements in a static camera setup and map them into Funscript actions using simple signal processing.
6+
7+
The Algorithm is implemented for 3D Side-By-Side VR Videos. Some parameter are currently hard coded. It should be possible to expand the functionality to 2D Videos by changing the code, with the following limitations.
8+
9+
### Limitations
10+
11+
- Static camera setup
12+
- Fixed reference point of relative movement in video required
13+
- No video cuts within a tracking sequence allowed
14+
- No change of position of the performers
15+
- Features in the video which are visible in all following frames of the tracking sequence required.
16+
17+
### Process
18+
19+
1. Selection of the features for the Woman and Men in the video, which should be tracked.
20+
2. Predict the feature positions in the following video frames by OpenCV Tracker.
21+
3. Calculate the difference between the predicted tracking boxes.
22+
4. Map the relative difference to an absolute difference score by user input.
23+
5. Filter all local min and max points to get the final action positions for the Funscript.
24+
25+
### Improvements
26+
27+
- You can change the OpenCV tracker in the source code which predicts the position. OpenCV offers several trackers which differ in prediction accuracy and processing speed. See also [OpenCV Tracker](https://learnopencv.com/object-tracking-using-opencv-cpp-python/).
28+
29+
- You can set the number of frames that are interpolated by the `skip_frames` parameter. 0 means that the OpenCV tracker delivers a prediction for each frame. This is slower but more accurate. Or if greater than zero, the individual frames are skipped and then the tracking boxes are interpolated, which increases the processing speed but decreases the accuracy. I have set the value to 1, i.e. every 2nd frame is skipped and interpolated. Which provides a good mix of accuracy and speed.
30+
31+
- It is recommended to use a low resolution video e.g. 4K for generating the funscript actions, as the processing speed is higher.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Open Funscripter Integration
2+
3+
Currently we use a hacky lua script to communicate between the Python Funscript Generator and the Open Funscripter.
4+
5+
## Installation
6+
7+
1. Download the latest packed Python Funscript Editor from [github release page](https://github.com/michael-mueller-git/Python-Funscript-Editor/releases).
8+
2. Extract the Archiv to an Path without special character or spaces.
9+
3. Copy the `funscript_generator.lua` script ([`Repositor/contrib/OpenFunscripter`](https://github.com/michael-mueller-git/Python-Funscript-Editor/tree/main/contrib/OpenFunscripter)) to `data/lua` in your OFS directory.
10+
4. Open the `funscript_generator.lua` file and adjust the `Settings.FunscriptGenerator` and `Settings.TmpFile` variable.
11+
- `Settings.FunscriptGenerator`: point to the extracted Python Funscript Editor program
12+
- `Settings.TmpFile`: specifies a temporary file where to store the result (must be a file not a directory!). The file will be overwritten automatically the next time the generator is started!
13+
5. Now launch OFS.
14+
6. Navigate to `View : Special functions : Custom Functions` and select the `funscript_generator.lua` entry. Click the Button `Bind Script` (This may trigger the funscript generator, just ignore it for now).
15+
7. Navigate to `Options : Keys : Dynamic` and insert a shortcut for the funscript generator.
16+
8. Now you can use the shortcut at any position in the video to start the funscript generator.

docs/app/docs/user-guide/ui.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# UI
2+
3+
The UI use an embedded mpv video player and matplotlib to draw the actions timeseries at the bottom.
4+
5+
## UI Keyboard Shortcuts
6+
7+
| Key | Function |
8+
| -------------------- | --------------------------- |
9+
| P | Pause / Playback |
10+
| . | Next frame |
11+
| , | Previous frame |
12+
| [ | Decrease speed |
13+
| ] | Increase speed |
14+
| Ctrl + Shift + Left | Previous Action Point |
15+
| Ctrl + Shift + Right | Next Action Point |
16+
| Shift + L | Loop Video |
17+
| W | Move Stroke Indicator Up |
18+
| A | Move Stroke Indicator Left |
19+
| S | Move Stroke Indicator Down |
20+
| D | Move Stroke Indicator Right |
21+
| Ctrl + I | Invert Stroke Indicator |
22+
| Ctrl + Plus | Increase Stroke Indicator |
23+
| Ctrl + Minus | Decrease Stroke Indicator |
24+
| Gtrl + G | Start Funscript Generator |
25+
| Shift + Pos1 | First Action Point |
26+
| Shift + End | Last Action Point |
27+
| Pos1 | Jump to Video Start |
28+
| End | Jump to Video End |
29+
| 0 | Add Action Point at 0% |
30+
| 1 | Add Action Point at 10% |
31+
| 2 | Add Action Point at 20% |
32+
| 3 | Add Action Point at 30% |
33+
| 4 | Add Action Point at 40% |
34+
| 5 | Add Action Point at 50% |
35+
| 6 | Add Action Point at 60% |
36+
| 7 | Add Action Point at 70% |
37+
| 8 | Add Action Point at 80% |
38+
| 9 | Add Action Point at 90% |

docs/app/mkdocs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
11
site_name: Funscript Editor
2+
pages:
3+
- Home: 'index.md'
4+
- User Guide:
5+
- 'OFS Integration': 'user-guide/ofs-integration.md'
6+
- 'UI': 'user-guide/ui.md'
7+
- 'Algorithms': 'user-guide/algorithms.md'

docs/app/site/404.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,36 @@
2424
<div class="navbar fixed-top navbar-expand-lg navbar-dark bg-primary">
2525
<div class="container">
2626
<a class="navbar-brand" href="/.">Funscript Editor</a>
27+
<!-- Expander button -->
28+
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbar-collapse">
29+
<span class="navbar-toggler-icon"></span>
30+
</button>
2731

2832
<!-- Expanded navigation -->
2933
<div id="navbar-collapse" class="navbar-collapse collapse">
34+
<!-- Main navigation -->
35+
<ul class="nav navbar-nav">
36+
<li class="navitem">
37+
<a href="/." class="nav-link">Home</a>
38+
</li>
39+
<li class="dropdown">
40+
<a href="#" class="nav-link dropdown-toggle" data-toggle="dropdown">User Guide <b class="caret"></b></a>
41+
<ul class="dropdown-menu">
42+
43+
<li>
44+
<a href="/user-guide/ofs-integration/" class="dropdown-item">OFS Integration</a>
45+
</li>
46+
47+
<li>
48+
<a href="/user-guide/ui/" class="dropdown-item">UI</a>
49+
</li>
50+
51+
<li>
52+
<a href="/user-guide/algorithms/" class="dropdown-item">Algorithms</a>
53+
</li>
54+
</ul>
55+
</li>
56+
</ul>
3057

3158
<ul class="nav navbar-nav ml-auto">
3259
<li class="nav-item">

0 commit comments

Comments
 (0)