Skip to content

Commit 9050a12

Browse files
authored
Merge pull request #46 from dfgHiatus/feat/linux-installer
(feat/fix) Add Linux installer script, fix misc_utils.py, update README
2 parents 1e84dd0 + 3447e95 commit 9050a12

File tree

3 files changed

+139
-38
lines changed

3 files changed

+139
-38
lines changed

BabbleApp/utils/misc_utils.py

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66
import platform
77
import cv2
88
import subprocess
9-
from pygrabber.dshow_graph import FilterGraph
10-
11-
is_nt = True if sys.platform.startswith('win') else False
12-
graph = FilterGraph()
139

10+
# Detect the operating system
11+
is_nt = os.name == "nt"
12+
os_type = platform.system()
1413

14+
if is_nt:
15+
from pygrabber.dshow_graph import FilterGraph
16+
graph = FilterGraph()
17+
18+
1519
def list_camera_names():
1620
cam_list = graph.get_input_devices()
1721
cam_names = []
@@ -20,14 +24,6 @@ def list_camera_names():
2024
cam_names = cam_names + list_serial_ports()
2125
return cam_names
2226

23-
# Detect the operating system
24-
is_nt = True if os.name == "nt" else False
25-
os_type = platform.system()
26-
27-
if is_nt:
28-
from pygrabber.dshow_graph import FilterGraph
29-
graph = FilterGraph()
30-
3127

3228
def list_cameras_opencv():
3329
""" Use OpenCV to check available cameras by index (fallback for Linux/macOS) """

README.md

Lines changed: 53 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,65 @@
1-
21
![Babble Logo](https://github.com/SummerSigh/ProjectBabble/blob/SummerSigh-patch-4/Babble.png?raw=true)
32

4-
# Table of Contents
5-
- [What is Babble?](#what-is-babble)
3+
<h3 align="center">
4+
Project Babble is an open-source mouth tracking project designed to work with any VR headset. We strive to make our models robust to different lighting, cameras, image qualities and facial structures!
5+
</h3>
6+
7+
## Table of Contents
68
- [Features](#features)
7-
- [How do I set it up?](#setup-more-detailed-wiki-and-setup-video-coming-soon)
8-
- [Useful Links](#useful-links)
9+
- [Installation](#installation)
10+
- [Usage](#usage)
11+
- [Links](#links)
912

10-
11-
## What is Babble?
12-
13-
<p align="center">
14-
Babble is an opensource mouth tracking project designed to work with any existing VR headset. We strive to make our models robust to different lighting, cameras, image qualities, and facial structures!
15-
</p>
16-
1713
## Features
18-
- 100% Opensource! 🌟
14+
- 100% open-source! 🌟
1915
- Fast and robust! 🚀
20-
- Works with most existing blendshape standards! ⚙️
16+
- Works with existing blendshape standards! ⚙️
2117
- Constantly updated and modified! 🔧
2218

23-
## Setup (More detailed wiki and setup video coming soon!)
24-
To install babble is fairly simple! Head over to the releases tab and download the EXE located there. Run the EXE and install babble! After that, you can test with a USB WEBCAM by doing the following steps:
19+
## Installation
20+
### Windows
21+
Head to the releases section and [download the latest installer](https://github.com/Project-Babble/ProjectBabble/releases/latest).
22+
23+
### Linux
24+
Install `git`, `curl` and a version of `python` greater than `3.8` for your distro.
25+
26+
Then, copy paste and run the following script into the terminal of your choice:
27+
28+
```bash
29+
bash -c "$(curl -fsSL https://gist.githubusercontent.com/dfgHiatus/a92a3caae24c1bfab1c7544537a654c5/raw/fc30aa550c3c7aa83c37a72168e75ef92388e39b/project-babble-install.sh)"
30+
```
31+
32+
Once it's finished installing, you can update and run the Babble app by typing `babble-app` into your terminal.
33+
34+
*You should also be able to run the Windows executable through Wine!*
35+
36+
#### Notes:
37+
If you receive a `["Error listing UVC devices on Linux ... No such file or directory"]` when choosing/changing your camera, you'll need to install video4linux (`v4l-utils`) for your distro.
38+
39+
For Ubuntu or other distros with apt:
40+
```bash
41+
sudo apt-get install v4l-utils
42+
```
43+
44+
If you receive a `ModuleNotFoundError: No module named 'tkinter'` error message on run, you'll need to install `tkinter` for your distro.
45+
46+
For Ubuntu or other distros with apt:
47+
```bash
48+
sudo apt-get install python3-tk
49+
```
50+
For Fedora:
51+
```bash
52+
sudo dnf install python3-tkinter
53+
```
2554

26-
- Run the babble app
27-
- Enter 0 into the camera address bar
28-
- Enter cropping mode where your camera feed should be
29-
- Crop your mouth out of the frame
30-
- Open VRCFT
31-
- Install the babble module
32-
- Test in VRC with a VRCFT-compatible avatar
55+
You can read more about this [here](https://stackoverflow.com/questions/25905540/importerror-no-module-named-tkinter).
3356

57+
## Usage
58+
We have integrations for [VRChat](https://docs.babble.diy/docs/software/integrations/vrc), [Resonite](https://docs.babble.diy/docs/software/integrations/resonite) and [ChilloutVR](https://docs.babble.diy/docs/software/integrations/chilloutVR)!
3459

35-
## Useful links
36-
- [Our Discord!](https://discord.gg/XAMZmjBktk)
37-
- [Wandb Runs](https://wandb.ai/summerai/ProjectBabble)
60+
Looking for something else? Check out our [documentation](https://docs.babble.diy/)!
3861

62+
## Links
63+
- [Our Discord](https://discord.gg/XAMZmjBktk)
64+
- [Our Twitter](https://x.com/projectBabbleVR)
65+
- [Wandb Runs](https://wandb.ai/summerai/ProjectBabble)

babbleapp.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
#!/bin/bash
2+
3+
# Check if running on Linux
4+
if [[ "$OSTYPE" != "linux-gnu"* ]]; then
5+
echo "Error: This script is only compatible with Linux operating systems."
6+
exit 1
7+
fi
8+
9+
# Check Python version
10+
if ! command -v python3 &> /dev/null; then
11+
echo "Error: Python is not installed. Please install Python 3.8 or higher."
12+
exit
13+
fi
14+
15+
python_version_major=$(python3 -c 'import platform; print(platform.python_version_tuple()[0])')
16+
python_version_minor=$(python3 -c 'import platform; print(platform.python_version_tuple()[1])')
17+
if (( python_version_major < 3 || python_version_minor < 8 )); then
18+
echo "Error: Your Python version is too low! Please install 3.8 or higher."
19+
exit 1
20+
fi
21+
22+
# Set installation directory
23+
install_dir="$HOME/.local/share/project-babble"
24+
25+
# Function to install requirements
26+
install_requirements() {
27+
cd $install_dir
28+
cd BabbleApp
29+
echo "Installing requirements..."
30+
# Create a temporary requirements file without the Windows-only package
31+
grep -v "onnxruntime-directml" requirements.txt > linux_requirements.txt
32+
pip install -r linux_requirements.txt --quiet
33+
rm linux_requirements.txt
34+
}
35+
36+
# Function to get the latest release tag
37+
get_latest_tag() {
38+
git fetch --tags
39+
git describe --tags --abbrev=0
40+
}
41+
42+
# Function to update the repository
43+
update_repo() {
44+
echo "Checking for updates..."
45+
git fetch --tags
46+
local_tag=$(git describe --tags --abbrev=0)
47+
remote_tag=$(git describe --tags --abbrev=0 origin/main)
48+
49+
if [ "$local_tag" != "$remote_tag" ]; then
50+
echo "New version available: $remote_tag"
51+
echo "Current version: $local_tag"
52+
echo "Updating to the latest version..."
53+
git checkout "$remote_tag"
54+
echo "Updating dependencies..."
55+
source venv/bin/activate
56+
install_requirements
57+
deactivate
58+
echo "Project Babble has been updated successfully to version $remote_tag!"
59+
else
60+
echo "Project Babble is already at the latest version: $local_tag"
61+
fi
62+
}
63+
64+
65+
cd $install_dir
66+
cd BabbleApp
67+
68+
# Create venv if it does not exists
69+
if ! [ -d "venv" ]; then
70+
python3 -m venv venv
71+
fi
72+
73+
source venv/bin/activate
74+
update_repo
75+
echo "Verifying dependencies. This might take a second!"
76+
install_requirements
77+
echo "Starting Babble app..."
78+
python3 babbleapp.py

0 commit comments

Comments
 (0)