Skip to content

Commit

Permalink
adding ai avatar stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
arackley-tribal committed Jul 9, 2024
1 parent 980aab5 commit 41f3e25
Show file tree
Hide file tree
Showing 56 changed files with 50,580 additions and 21 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
2 changes: 1 addition & 1 deletion AutoIMage/auto-images/src/app/components/InstagramPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function InstagramPost(props: InstagramPostProps) {
};

return (
<div id={props.id}>
<div id={props.id} style={{overflow: 'hidden'}} data-savable>
{props.id}
<div ref={elementRef} style={{
width: props.width,
Expand Down
24 changes: 14 additions & 10 deletions AutoIMage/auto-images/src/app/components/InstagramVerticalPost.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,23 @@ export function InstagramVerticalPost(props: InstagramVerticalPostProps) {
const elementRef = useRef(null);

const htmlToImageConvert = async () => {
if(elementRef.current){
const dataUtrl = await toPng(elementRef.current, { cacheBust: false })
const link = document.createElement("a");
link.download = `${props.id}.png`;
link.href = dataUtrl;
link.click();
}
console.log('clicked')
toPng(elementRef.current, { cacheBust: false })
.then((dataUrl) => {
const link = document.createElement("a");
link.download = "my-image-name.png";
link.href = dataUrl;
link.click();
})
.catch((err) => {
console.log(err);
});
};

return (
<div id={props.id}>
{props.id}
<div ref={elementRef} style={{
<div ref={elementRef} id={props.id} style={{overflow: 'hidden'}} data-savable>
{props.id} <button onClick={htmlToImageConvert}>Download</button>
<div style={{
width: props.width,
height: props.height,
backgroundImage: `url("${props.values[0]}-tall.png")`,
Expand Down
20 changes: 12 additions & 8 deletions AutoIMage/auto-images/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export default function Home() {
],
['https://www.volkswagen.co.uk/api/image/2.3/car/hero/model/id/30205/exterior-front/1080.png',
'https://www.volkswagen.co.uk/api/image/2.3/car/hero/model/id/30251/exterior-front/1080.png',
'https://www.volkswagen.co.uk/api/image/2.3/car/hero/model/id/30260/exterior-front/1080.png'],
'https://www.volkswagen.co.uk/api/image/2.3/car/hero/model/id/30260/exterior-front/1080.png'
'https://www.volkswagen.co.uk/api/image/2.3/car/hero/model/id/30360/exterior-side/1080.png',
'https://www.volkswagen.co.uk/api/image/2.3/car/hero/model/id/30360/exterior-rear/1080.png'],
['GET £2,500','SPRING SALE','NEW OFFER'],
['TOWARDS YOUR T-ROC FINANCE DEPOSIT','TOWARDS YOUR FINANCE DEPOSIT','TOWARDS YOUR DEPOSIT'],
['WITH SOLUTIONS PCP'],
Expand All @@ -38,20 +40,22 @@ export default function Home() {
const perms = _cartesianProductOf(
[
[ 'http://localhost:3000/image-sets/backgrounds/1',
'http://localhost:3000/image-sets/backgrounds/2',
'http://localhost:3000/image-sets/backgrounds/3'
'http://localhost:3000/image-sets/backgrounds/2',
'http://localhost:3000/image-sets/backgrounds/3'
],
['https://www.volkswagen.co.uk/api/image/2.3/car/hero/model/id/30360/exterior-front/1080.png',
'https://www.volkswagen.co.uk/api/image/2.3/car/hero/model/id/30260/exterior-front/1080.png'],
['SAVE £2,500','GET £2,500', 'GET £11,500'],
['TOWARDS YOUR T-ROC FINANCE DEPOSIT'],
['WITH SOLUTIONS PCP'],
'https://www.volkswagen.co.uk/api/image/2.3/car/hero/model/id/30360/exterior-side/1080.png',
'https://www.volkswagen.co.uk/api/image/2.3/car/hero/model/id/30360/exterior-rear/1080.png',
],
['HEY AARON!'],
['YOU CAN SAVE £750 ON THE NEW T-ROC'],
['CLICK HERE TO FIND OUR MORE'],
['Representative'],
['7.5% APR'],
['Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi vel auctor lorem. Vivamus et tristique sem. Sed nec velit sit amet tortor euismod sollicitudin. Ut nec justo mattis, rutrum urna nec.']
]
)
/*
/*
const perms = _cartesianProductOf(
[
[ 'http://localhost:3000/image-sets/backgrounds/1.png'
Expand Down
3 changes: 3 additions & 0 deletions AutoIMage/auto-images/src/app/pages/api/ad.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function handler(req, res) {
res.status(200).json({ text: 'Hello' });
}
2 changes: 1 addition & 1 deletion AutoIMage/auto-images/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "src/app/pages/api/ad.js"],
"exclude": ["node_modules"]
}
1 change: 0 additions & 1 deletion IdBuzz/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
}
</style>

of a
<body>
<div class="model-text">ID.4</div>
<div class="main-container">
Expand Down
23 changes: 23 additions & 0 deletions avatar/azure-avatar-demo-main/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
58 changes: 58 additions & 0 deletions avatar/azure-avatar-demo-main/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Azure Avatar Demo

Welcome to the Azure Avatar Demo! This project showcases the integration of Azure AI's Text-to-Speech Avatar feature into a ReactJS application. With this application, you can bring lifelike synthetic talking avatars to your projects.

[Watch the Demo Video](./demovideo/AvatarAzureMediumDemo.mp4)

Click the link above to watch a demo of the Azure Avatar in action!


## NOTICE

Microsoft is now retiring azure TURN services. Azure TTS avatar was using azure turn services for communication.
I have added script to install coturn on ubuntu instance. Execute installCoturn.sh to setup your own TURN server.

Refer this medium link ->

https://raokarthik83.medium.com/azure-avatar-tts-update-migrating-from-azure-turn-to-coturn-14b6ac86d60c



## Getting Started

Follow these steps to set up and run the application locally:

1. **Clone the Repository:**
```bash
git clone https://github.com/hacktronaut/azure-avatar-demo.git
cd azure-avatar-demo

2. **Install Dependencies:**
```bash
npm install
```
3. **Start the Application:**
```bash
npm start
```

The application will be accessible at http://localhost:3000 in your web browser.

### Configuration

Make sure to configure the necessary API keys and settings in the config.js file before running the application.

```javascript
// config.js
export const avatarAppConfig = {
cogSvcRegion: 'your-region',
cogSvcSubKey: 'your-subscription-key',
// ... (other configuration options)
};
```

### Feedback and Issues

If you encounter any issues or have feedback, please open an issue. We welcome your contributions and suggestions!

Happy coding!
Binary file not shown.
68 changes: 68 additions & 0 deletions avatar/azure-avatar-demo-main/installCoturn.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash

# Update package repositories
sudo apt-get -y update

# Install Coturn server
sudo apt-get install coturn -y

# Stop Coturn server
sudo service coturn stop

# Enable TURN server by adding configuration in /etc/default/coturn
echo 'TURNSERVER_ENABLED=1' | sudo tee -a /etc/default/coturn

# Backup existing turnserver.conf and create a new one
sudo mv /etc/turnserver.conf /etc/turnserver.conf.bak
sudo touch /etc/turnserver.conf

# Add configuration to the turnserver.conf file
sudo tee /etc/turnserver.conf > /dev/null <<EOF
# Listener IP address of relay server. Multiple listeners can be specified.
# If no IP(s) specified in the config file or in the command line options,
# then all IPv4 and IPv6 system IPs will be used for listening.
listening-ip=0.0.0.0
#listening-ip=10.207.21.238
#listening-ip=2607:f0d0:1002:51::4
min-port=49152
max-port=65535
# Uncomment to run TURN server in 'normal' 'moderate' verbose mode.
# By default the verbose mode is off.
verbose
# Uncomment to use fingerprints in the TURN messages.
# By default the fingerprints are off.
fingerprint
# Uncomment to use long-term credential mechanism.
# By default no credentials mechanism is used (any user allowed).
lt-cred-mech
# 'Static' user accounts are NOT dynamically checked by the turnserver process,
# so that they can NOT be changed while the turnserver is running.
user=user117:passworD@368
#user=username2:key2
# OR:
#user=username1:password1
# Log file location
log-file=/var/log/turn.log
# Option to redirect all log output into system log (syslog).
syslog
# Enable Web-admin support on https. By default it is Disabled.
# If it is enabled it also enables a http a simple static banner page
# with a small reminder that the admin page is available only on https.
web-admin
# Local system IP address to be used for Web-admin server endpoint. Default value is 127.0.0.1.
web-admin-ip=0.0.0.0
# Web-admin server port. Default is 8080.
EOF

# Restart Coturn server to apply the changes
sudo service coturn restart
Loading

0 comments on commit 41f3e25

Please sign in to comment.