diff --git a/Animalese_translator/.gitignore b/Animalese_translator/.gitignore new file mode 100644 index 00000000..ea1472ec --- /dev/null +++ b/Animalese_translator/.gitignore @@ -0,0 +1 @@ +output/ diff --git a/Animalese_translator/Dockerfile b/Animalese_translator/Dockerfile new file mode 100644 index 00000000..9364498b --- /dev/null +++ b/Animalese_translator/Dockerfile @@ -0,0 +1,20 @@ +FROM python:3.12-slim + +WORKDIR /app + +RUN apt-get update && apt-get install -y \ + python3-gi \ + gir1.2-gstreamer-1.0 \ + gstreamer1.0-plugins-base \ + gstreamer1.0-plugins-good \ + python3-gst-1.0 \ + && rm -rf /var/lib/apt/lists/* + +COPY requirements.txt . + +RUN pip install --upgrade pip && \ + pip install -r requirements.txt --break-system-packages + +COPY . . + +CMD ["python3", "main.py"] diff --git a/Animalese_translator/README.md b/Animalese_translator/README.md index f4072203..85c972b1 100644 --- a/Animalese_translator/README.md +++ b/Animalese_translator/README.md @@ -34,12 +34,28 @@ and how to install them. ## 🌟 How to run Steps on how to run the script along with suitable examples. +1. Build docker image +```bash +docker build -t animalese_translator . +``` + +2. Run the container +```bash +docker run -v $(pwd)/output:/app/output animalese_translator +``` + +3. Check output on your localhost the output folder will get created +```bash +aplay output/Hello_World.wav +``` +Run this cmd. ## 📺 Demo -Add a Screenshot/GIF showing the sample use of the script (jpeg/png/gif). +image + ## 🤖 Author Adapted from [vegalious](https://github.com/wegfawefgawefg) -[Yurner0](https://github.com/Yurnero-cyber) \ No newline at end of file +[Yurner0](https://github.com/Yurnero-cyber) diff --git a/Animalese_translator/main.py b/Animalese_translator/main.py index 7a53a0ba..c0026f29 100644 --- a/Animalese_translator/main.py +++ b/Animalese_translator/main.py @@ -16,7 +16,7 @@ import numpy as np # if you pip install scipy numpy will come too -voice_path = "/home/wilson/Documentos/git_repo/python-mini-project/Animalese_translator/voices/guy3" +voice_path = "/app/voices/guy3" files = os.listdir(voice_path) # lists the containing names of the entries of the specified directory @@ -59,7 +59,7 @@ # say_this = "pastee luuk at des" # say_this = "kil haw es yor de goeng" # say_this = "weleam haw was yor de" -say_this = "i med somteng kul" +say_this = "Hello World" # say_this = "ame i lov yuu vere alat" # say_this = "ef yu wurk hard yu wel hav a gud lif" @@ -106,6 +106,7 @@ file_path = os.path.join(output_dir, name + '.wav') write_rate = int(sample_rate*speed_multiplier) write(file_path, write_rate, base.astype(np.int16)) -playsound(file_path) +#playsound(file_path) +print(f"Audio saved to {file_path}") # for file in files: # playsound(voice_path + "/" + file) diff --git a/Animalese_translator/requirements.txt b/Animalese_translator/requirements.txt new file mode 100644 index 00000000..7e4bdb2c --- /dev/null +++ b/Animalese_translator/requirements.txt @@ -0,0 +1,3 @@ +playsound==1.2.2 +scipy +numpy diff --git a/Caterpillar_Game/Dockerfile b/Caterpillar_Game/Dockerfile new file mode 100644 index 00000000..eb9ed78c --- /dev/null +++ b/Caterpillar_Game/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3.12-slim + +RUN apt-get update && apt-get install -y \ + python3-tk \ + xvfb \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app + +COPY . . + +CMD ["python3", "Caterpillar.py"] diff --git a/Caterpillar_Game/README.md b/Caterpillar_Game/README.md index 9d6cc298..5bc0e1f4 100644 --- a/Caterpillar_Game/README.md +++ b/Caterpillar_Game/README.md @@ -22,9 +22,35 @@ Running the script is really simple! Just open a terminal in the folder where yo ```sh python Caterpillar.py ``` +## How to run as a docker file. For Ubuntu machine. +### Steps: +1. Connect to the server with X11 forwarding: +```bash +ssh -X @ +``` + +2. Allow X11 access: +```bash +xhost +local:docker +``` + +3. Build the Docker image: +```bash +docker build -t caterpillar-game . +``` + +4. Run the container: +```bash +docker run --network host \ + -e DISPLAY=localhost:10.0 \ + -e XAUTHORITY=/home/$USER/.Xauthority \ + -v /home/$USER/.Xauthority:/home/$USER/.Xauthority \ + caterpillar-game +``` + ## 📺 Demo

## 🤖 Author -[Leah Nguyen](https://github.com/ndleah) \ No newline at end of file +[Leah Nguyen](https://github.com/ndleah)