TheStinger commited on
Commit
6863518
1 Parent(s): 29cf945

initial commit

Browse files
Files changed (6) hide show
  1. .gitattributes +1 -0
  2. LICENSE.md +32 -0
  3. README.md +61 -3
  4. app.py +85 -0
  5. ilariaaisuite.png +3 -0
  6. requirements.txt +7 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ ilariaaisuite.png filter=lfs diff=lfs merge=lfs -text
LICENSE.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ilaria's Non-Commercial Use License (INCU)
2
+
3
+ ## 1. Definitions
4
+
5
+ - "Software" refers to the content present within this repository including code, graphics, sounds, images, text, and other files.
6
+ - "You" refers to the individual or entity that wishes to use the Software.
7
+ - "Ilaria" refers to the original creator of the Software.
8
+ - "Fork" refers to the action of creating a personal copy of another user's repository.
9
+
10
+ ## 2. Grant of Rights
11
+
12
+ Subject to the terms of this license, Ilaria hereby grants You a worldwide, royalty-free, non-exclusive, perpetual license to use the Software for personal, non-commercial purposes. This includes the rights to use, copy, modify, merge, publish, and distribute the Software for non-commercial purposes.
13
+
14
+ ## 3. Redistribution
15
+
16
+ You may not distribute or sell the Software, or any derivative works based on the Software, unless you have been specifically granted permission by Ilaria. Any permitted redistribution must also be under the terms of this license. Unauthorized distribution is strictly prohibited and will result in the termination of this license.
17
+
18
+ ## 4. Commercial Use
19
+
20
+ Commercial use of the Software is strictly prohibited without the express written consent of Ilaria. Small businesses may be granted permission to use the Software for profit, but large corporations must negotiate a commercial agreement with Ilaria. Unauthorized commercial use is strictly prohibited and will result in the termination of this license.
21
+
22
+ ## 5. Forking and Personal Use
23
+
24
+ You are free to fork and modify the Software for your own personal use. You may not distribute, publicly display, or create derivative works from your modifications unless granted permission by Ilaria. All modifications must also be under the terms of this license.
25
+
26
+ ## 6. Liability
27
+
28
+ Ilaria provides the Software "as is," without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and non-infringement. In no event shall Ilaria be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Software or the use or other dealings in the Software. You agree to use the Software at your own risk.
29
+
30
+ ## 7. Governing Law
31
+
32
+ This license is governed by the laws of the jurisdiction in which Ilaria resides. Any disputes related to this license will be resolved in the courts of that jurisdiction.
README.md CHANGED
@@ -1,12 +1,70 @@
1
  ---
2
  title: Ilaria Converter
3
- emoji: 🐨
4
  colorFrom: pink
5
- colorTo: purple
6
  sdk: gradio
7
  sdk_version: 4.8.0
8
  app_file: app.py
9
  pinned: false
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  title: Ilaria Converter
3
+ emoji: 🔨
4
  colorFrom: pink
5
+ colorTo: pink
6
  sdk: gradio
7
  sdk_version: 4.8.0
8
  app_file: app.py
9
  pinned: false
10
  ---
11
 
12
+ ![Ilaria Converter](./ilariaaisuite.png)
13
+ ***
14
+ [![Static Badge](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Space-s?labelColor=YELLOW&color=FFEA00)](https://huggingface.co/spaces/TheStinger/Ilaria_Converter) [![Static Badge](https://img.shields.io/badge/%F0%9F%A4%97%20HF%20Space-Duplication-s?labelColor=YELLOW&color=FFEA00)](https://huggingface.co/spaces/TheStinger/Ilaria_Converter?duplicate=true) [![Static Badge](https://img.shields.io/badge/GitHub-Source%20Code-s?logo=GitHub)](https://github.com/TheStingerX/Ilaria-Converter) [![Static Badge](https://img.shields.io/badge/AI%20Hub-Discord%20Server-s?logo=Discord&color=%09%237289da)](https://discord.gg/aihub) [![Static Badge](https://img.shields.io/badge/Ko--Fi-s?logo=Ko-Fi&label=Support%20me%20on&labelColor=434b57&color=FF5E5B)](https://ko-fi.com/ilariaowo)
15
+ ***
16
+ <p align="center">
17
+ <h1>Ilaria Converter 💖</h1>
18
+ </p>
19
+
20
+ 🎉 Welcome to Ilaria Converter! 🎉
21
+
22
+ This project leverages various libraries and modules to create a Graphical User Interface (GUI) for advanced file conversion.
23
+ It's primarily designed for use with HuggingFace Spaces. 🤗
24
+
25
+ Ilaria Converter is part of the Ilaria AI Suite which includes various easy and powerful tools. 💖
26
+
27
+ ## 📦 Installation 📦
28
+
29
+ To use this project, clone the original Space on Hugging Face.
30
+ Make sure you restart it from time to time to keep up with the new updates.
31
+
32
+ ## 🖥️ Usage 🖥️
33
+
34
+ Once the dependencies are installed automatically, Hugging Face will use app.py to start the user interface.
35
+ From there, you can utilize the various features of the project.
36
+
37
+ ## 🌟 Features 🌟
38
+
39
+ Ilaria Converter offers a range of features, including:
40
+
41
+ - 🎵 **Audio Conversion**:
42
+ Ilaria Converter uses the ffmpeg module to convert audio files to various formats.
43
+ It provides options to change the bitrate of the audio file.
44
+
45
+ - 🖼️ **Image Conversion**:
46
+ Ilaria Converter uses the PIL and ffmpeg modules to convert images to various formats.
47
+ It provides options to change the resolution of the image.
48
+
49
+ - 🌍 **User-Friendly Web Interface**:
50
+ Ilaria Converter uses the gradio module to create an intuitive web interface.
51
+ Users can easily upload a file, and the application will return the converted file.
52
+
53
+ - 📂 **Efficient File Handling**:
54
+ Ilaria Converter uses the os and tempfile modules for efficient file handling operations.
55
+ It saves the converted file and returns the path of the file.
56
+
57
+ ## 🙏 Credits 🙏
58
+
59
+ - **Alex Murkoff** - For his invaluable help and useful tips
60
+
61
+ ## 🤝 Contributing 🤝
62
+
63
+ Interested in contributing to this project? Ilaria is always looking for collaborators.
64
+ Feel free to open a pull request on Hugging Face.
65
+
66
+ ## 📄 License 📄
67
+
68
+ This project is released under the `INCU` license.
69
+ For more details, please check the license file.
70
+ For further questions feel free to contact Ilaria.
app.py ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from PIL import Image
3
+ from PIL import ImageSequence
4
+ import numpy as np
5
+ from apng import APNG
6
+ import os
7
+ import subprocess
8
+
9
+ def main():
10
+ # Gradio Interface
11
+ with gr.Blocks() as app:
12
+ gr.Markdown(
13
+ """
14
+ # <div align="center"> Ilaria Converter 💖 </div>
15
+ File conversion Software by Ilaria, support me on [Ko-Fi!](https://ko-fi.com/ilariaowo)
16
+
17
+ Need help with AI? [Join AI Hub!](https://discord.gg/aihub)
18
+ """
19
+ )
20
+
21
+ with gr.Tab('Audio Conversion'):
22
+ with gr.Row():
23
+ audio_input = gr.Audio(type='filepath')
24
+ with gr.Column():
25
+ audio_output_format = gr.Dropdown(["wav", "flac", "ogg", "mp3", "aac", "m4a"], label="Audio Output Format")
26
+ change_bitrate = gr.Checkbox(label="Change Bitrate?")
27
+ audio_bitrate = gr.Dropdown(["128", "256", "320"], label="Audio Bitrate")
28
+ convert_audio_butt = gr.Button(value='Convert Audio', variant='primary')
29
+ audio_output = gr.Audio(type='filepath', label="Converted Audio")
30
+
31
+ convert_audio_butt.click(fn=convert_audio, inputs=[audio_input, audio_output_format, change_bitrate, audio_bitrate], outputs=audio_output)
32
+
33
+ with gr.Tab('Image Conversion'):
34
+ with gr.Row():
35
+ image_input = gr.Image(type='filepath', image_mode='RGBA')
36
+ with gr.Column():
37
+ image_output_format = gr.Dropdown(["png", "jpg", "tiff", "bmp", "webp", "gif", "apng"], label="Image Output Format")
38
+ change_resolution = gr.Checkbox(label="Change Resolution?")
39
+ image_width = gr.Number(label="Image Width")
40
+ image_height = gr.Number(label="Image Height")
41
+ convert_image_butt = gr.Button(value='Convert Image', variant='primary')
42
+ image_output = gr.Image(type='filepath', label="Converted Image")
43
+
44
+ convert_image_butt.click(fn=convert_image, inputs=[image_input, image_output_format, change_resolution, image_width, image_height], outputs=image_output)
45
+
46
+ app.queue(max_size=1022).launch(share=False)
47
+
48
+ def convert_audio(audio_file, output_format, change_bitrate, bitrate):
49
+ # Get the base name of the input file
50
+ base_name = os.path.splitext(os.path.basename(audio_file))[0]
51
+
52
+ # Convert the audio file to the selected format
53
+ output_audio_file = f'{base_name}.{output_format}'
54
+
55
+ # Create the ffmpeg command
56
+ command = ['ffmpeg', '-y', '-i', audio_file]
57
+ if change_bitrate:
58
+ command.extend(['-b:a', f'{bitrate}k'])
59
+ command.append(output_audio_file)
60
+
61
+ # Run the command
62
+ subprocess.run(command, check=True)
63
+
64
+ return output_audio_file
65
+
66
+ def convert_image(input_image, output_format, change_resolution, width, height):
67
+ base_name = os.path.splitext(os.path.basename(input_image))[0]
68
+
69
+ out_file = f'{base_name}.{output_format}'
70
+
71
+ command = ['ffmpeg', '-y', '-i', input_image, '-vframes', '1']
72
+
73
+ if change_resolution:
74
+ command.extend(['-vf', f'scale={width}:{height}'])
75
+
76
+ command.append(out_file)
77
+
78
+ subprocess.run(command, check=True)
79
+
80
+ print(f'Converted {input_image} to {out_file}')
81
+
82
+ return out_file
83
+
84
+ # Create the Gradio interface
85
+ main()
ilariaaisuite.png ADDED

Git LFS Details

  • SHA256: 60831754632678b333f6301cddb6c96234cfec9750424e60dbed657e0541fcfc
  • Pointer size: 132 Bytes
  • Size of remote file: 2.76 MB
requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ gradio
2
+ pillow
3
+ soundfile
4
+ imageio
5
+ apng
6
+ pydub
7
+ ffmpeg