Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Animalese_translator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
output/
20 changes: 20 additions & 0 deletions Animalese_translator/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
20 changes: 18 additions & 2 deletions Animalese_translator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,28 @@ and how to install them.
## 🌟 How to run
<!--Remove the below lines and add yours -->
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).
<img width="1379" height="124" alt="image" src="https://github.com/user-attachments/assets/fa3d34ac-43de-45ca-9daf-3aaa9c206c47" />


## πŸ€– Author
<!--Remove the below lines and add yours -->
Adapted from [vegalious](https://github.com/wegfawefgawefg)

[Yurner0](https://github.com/Yurnero-cyber)
[Yurner0](https://github.com/Yurnero-cyber)
7 changes: 4 additions & 3 deletions Animalese_translator/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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)
3 changes: 3 additions & 0 deletions Animalese_translator/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
playsound==1.2.2
scipy
numpy
12 changes: 12 additions & 0 deletions Caterpillar_Game/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
28 changes: 27 additions & 1 deletion Caterpillar_Game/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <username>@<hostname>
```

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
<p align="center">
<img src="https://github.com/ndleah/python-mini-project/blob/main/IMG/caterpillar.gif" width=70% height=70%>

## πŸ€– Author
[Leah Nguyen](https://github.com/ndleah)
[Leah Nguyen](https://github.com/ndleah)