Compare commits
10 Commits
f9460828bb
...
872f323226
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
872f323226 | ||
|
|
0cedb583a1 | ||
|
|
b96870d7ed | ||
|
|
1028dd5a3e | ||
|
|
b720850abe | ||
|
|
2f2bc039eb | ||
|
|
e968743c16 | ||
|
|
12588fc65f | ||
|
|
2fe5b26692 | ||
|
|
c59e376fe5 |
BIN
other/ow-map/images/ash.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
other/ow-map/images/attlerock.webp
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
other/ow-map/images/brittle.webp
Normal file
|
After Width: | Height: | Size: 7.9 KiB |
BIN
other/ow-map/images/dark.webp
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
other/ow-map/images/ember.webp
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
other/ow-map/images/eye.webp
Normal file
|
After Width: | Height: | Size: 6.5 KiB |
BIN
other/ow-map/images/giant.webp
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
other/ow-map/images/inter.webp
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
other/ow-map/images/station.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
other/ow-map/images/sun.webp
Normal file
|
After Width: | Height: | Size: 9.0 KiB |
BIN
other/ow-map/images/timber.webp
Normal file
|
After Width: | Height: | Size: 9.7 KiB |
BIN
other/ow-map/images/white.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
23
other/ow-map/index.css
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
.object {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
margin: auto;
|
||||||
|
/* More styles here */
|
||||||
|
}
|
||||||
|
|
||||||
|
.planet {
|
||||||
|
/* Styles for planets here */
|
||||||
|
}
|
||||||
|
|
||||||
|
.p-orbit {
|
||||||
|
/* Styles for orbits here */
|
||||||
|
}
|
||||||
|
|
||||||
|
#solar-system {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
}
|
||||||
21
other/ow-map/index.html
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>Outer wilds solar system</title>
|
||||||
|
<script src="index.js" defer></script>
|
||||||
|
<link rel="stylesheet" href="index.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="solar-system">
|
||||||
|
<div class="object p-orbit"></div>
|
||||||
|
<img class="object" src="images/sun.webp" alt="" id="sun">
|
||||||
|
<img class="object planet" src="images/station.webp" alt="" id="station">
|
||||||
|
<img class="object planet" src="images/ash.webp" alt="" id="ash">
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
10
other/ow-map/index.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
const planets = document.querySelectorAll('.planet')
|
||||||
|
let radians = new Array(planets.length).fill(0)
|
||||||
|
setInterval(() => {
|
||||||
|
planets.forEach((planet, index) => {
|
||||||
|
let x = Math.cos(radians[index]) * 100; // 100 is the radius of the orbit
|
||||||
|
let y = Math.sin(radians[index]) * 100; // 100 is the radius of the orbit
|
||||||
|
planet.style.transform = `translate(${x}px, ${y}px)`;
|
||||||
|
radians[index] += 0.02 // Adjust this value to change speed
|
||||||
|
})
|
||||||
|
}, 1000/60)
|
||||||
@ -3,13 +3,15 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Audio Classification</title>
|
<title>Audio Classification</title>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@2.8.4/dist/tf.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@2.8.4/dist/tf.min.js"></script>
|
||||||
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/speech-commands@0.4.0/dist/speech-commands.min.js"></script>
|
|
||||||
<script src="script.js" defer></script>
|
<script src="script.js" defer></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div>Audio Model</div>
|
<h1>Audio Classification</h1>
|
||||||
<button type="button" onclick="init()">Start</button>
|
<form>
|
||||||
<div id="label-container"></div>
|
<input type="file" id="audioFile" name="audioFile"/>
|
||||||
|
<button type="submit">Upload</button>
|
||||||
|
</form>
|
||||||
|
<section id="result"></section>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
@ -1,50 +1,63 @@
|
|||||||
// more documentation available at
|
// Load the TensorFlow.js model
|
||||||
// https://github.com/tensorflow/tfjs-models/tree/master/speech-commands
|
async function loadModel() {
|
||||||
|
const model = await tf.loadLayersModel("model/model.json");
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
// the link to your model provided by Teachable Machine export panel
|
function preprocessAudio(filename) {
|
||||||
const URL = "./model/";
|
// Load audio file
|
||||||
|
const audio = new Audio(filename);
|
||||||
|
|
||||||
async function createModel() {
|
// Generate a Mel-scaled spectrogram
|
||||||
const checkpointURL = URL + "model.json"; // model topology
|
const spectrogram = tf.tidy(() => {
|
||||||
const metadataURL = URL + "metadata.json"; // model metadata
|
const audioTensor = tf.browser.Audio(audio);
|
||||||
|
const sampleRate = audioTensor.sampleRate();
|
||||||
|
const melSpectrogram = tf.signal.melSpectrogram(audioTensor, {
|
||||||
|
sampleRate: sampleRate,
|
||||||
|
hopLength: 512,
|
||||||
|
nMels: 128,
|
||||||
|
fMin: 0,
|
||||||
|
fMax: 8000
|
||||||
|
});
|
||||||
|
const logMelSpectrogram = tf.math.log(melSpectrogram.add(1e-6));
|
||||||
|
const normalizedSpectrogram = logMelSpectrogram.div(tf.max(logMelSpectrogram));
|
||||||
|
return normalizedSpectrogram;
|
||||||
|
});
|
||||||
|
|
||||||
const recognizer = speechCommands.create(
|
return spectrogram;
|
||||||
"BROWSER_FFT", // fourier transform type, not useful to change
|
}
|
||||||
undefined, // speech commands vocabulary feature, not useful for your models
|
|
||||||
checkpointURL,
|
|
||||||
metadataURL);
|
|
||||||
|
|
||||||
// check that model and metadata are loaded via HTTPS requests.
|
|
||||||
await recognizer.ensureModelLoaded();
|
|
||||||
|
|
||||||
return recognizer;
|
// Classify the audio using the loaded model
|
||||||
}
|
async function classifyAudio(model, audioData) {
|
||||||
|
const preprocessedData = preprocessAudio(audioData);
|
||||||
|
const audioTensor = tf.tensor(preprocessedData);
|
||||||
|
const predictions = model.predict(audioTensor);
|
||||||
|
const predictedClass = predictions.argMax().dataSync()[0];
|
||||||
|
return predictedClass;
|
||||||
|
}
|
||||||
|
|
||||||
async function init() {
|
// Handle form submission
|
||||||
const recognizer = await createModel();
|
document.querySelector("form").addEventListener("submit", async function(event) {
|
||||||
const classLabels = recognizer.wordLabels(); // get class labels
|
event.preventDefault();
|
||||||
const labelContainer = document.getElementById("label-container");
|
const fileInput = document.getElementById("audioFile");
|
||||||
for (let i = 0; i < classLabels.length; i++) {
|
const file = fileInput.files[0];
|
||||||
labelContainer.appendChild(document.createElement("div"));
|
const fileReader = new FileReader();
|
||||||
}
|
|
||||||
|
|
||||||
// listen() takes two arguments:
|
fileReader.onload = async function(event) {
|
||||||
// 1. A callback function that is invoked anytime a word is recognized.
|
const audioData = event.target.result;
|
||||||
// 2. A configuration object with adjustable fields
|
|
||||||
recognizer.listen(result => {
|
|
||||||
const scores = result.scores; // probability of prediction for each class
|
|
||||||
// render the probability scores per class
|
|
||||||
for (let i = 0; i < classLabels.length; i++) {
|
|
||||||
const classPrediction = classLabels[i] + ": " + result.scores[i].toFixed(2);
|
|
||||||
labelContainer.childNodes[i].innerHTML = classPrediction;
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
includeSpectrogram: true, // in case listen should return result.spectrogram
|
|
||||||
probabilityThreshold: 0.75,
|
|
||||||
invokeCallbackOnNoiseAndUnknown: true,
|
|
||||||
overlapFactor: 0.50 // probably want between 0.5 and 0.75. More info in README
|
|
||||||
});
|
|
||||||
|
|
||||||
// Stop the recognition in 5 seconds.
|
// Load the model
|
||||||
// setTimeout(() => recognizer.stopListening(), 5000);
|
const model = await loadModel();
|
||||||
}
|
|
||||||
|
// Classify the audio
|
||||||
|
const classificationResult = await classifyAudio(model, audioData);
|
||||||
|
|
||||||
|
// Display the classification result
|
||||||
|
const resultSection = document.getElementById("result");
|
||||||
|
resultSection.textContent = `Class: ${classificationResult}`;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Read the uploaded audio file
|
||||||
|
fileReader.readAsArrayBuffer(file);
|
||||||
|
});
|
||||||
|
|||||||
13
site.torrent
24
sitemap.txt
@ -183,6 +183,9 @@ https://boof.eu.org/other/lowband/
|
|||||||
https://boof.eu.org/other/lowband/videos.html
|
https://boof.eu.org/other/lowband/videos.html
|
||||||
https://boof.eu.org/other/lowband/vsauce.html
|
https://boof.eu.org/other/lowband/vsauce.html
|
||||||
https://boof.eu.org/other/nostalgia/
|
https://boof.eu.org/other/nostalgia/
|
||||||
|
https://boof.eu.org/other/ow-map/
|
||||||
|
https://boof.eu.org/other/ow-map/index.css
|
||||||
|
https://boof.eu.org/other/ow-map/index.js
|
||||||
https://boof.eu.org/other/urls to array/
|
https://boof.eu.org/other/urls to array/
|
||||||
https://boof.eu.org/other/urls to array/index.js
|
https://boof.eu.org/other/urls to array/index.js
|
||||||
https://boof.eu.org/tools/Base64/
|
https://boof.eu.org/tools/Base64/
|
||||||
@ -4958,8 +4961,22 @@ https://boof.eu.org/other/csv-merge/files/random strings sha256.txt
|
|||||||
https://boof.eu.org/other/csv-merge/files/random strings.txt
|
https://boof.eu.org/other/csv-merge/files/random strings.txt
|
||||||
https://boof.eu.org/other/nostalgia/old games/
|
https://boof.eu.org/other/nostalgia/old games/
|
||||||
https://boof.eu.org/other/nostalgia/old movies and videos/
|
https://boof.eu.org/other/nostalgia/old movies and videos/
|
||||||
|
https://boof.eu.org/other/ow-map/images/ash.webp
|
||||||
|
https://boof.eu.org/other/ow-map/images/attlerock.webp
|
||||||
|
https://boof.eu.org/other/ow-map/images/brittle.webp
|
||||||
|
https://boof.eu.org/other/ow-map/images/dark.webp
|
||||||
|
https://boof.eu.org/other/ow-map/images/ember.webp
|
||||||
|
https://boof.eu.org/other/ow-map/images/eye.webp
|
||||||
|
https://boof.eu.org/other/ow-map/images/giant.webp
|
||||||
|
https://boof.eu.org/other/ow-map/images/inter.webp
|
||||||
|
https://boof.eu.org/other/ow-map/images/station.webp
|
||||||
|
https://boof.eu.org/other/ow-map/images/sun.webp
|
||||||
|
https://boof.eu.org/other/ow-map/images/timber.webp
|
||||||
|
https://boof.eu.org/other/ow-map/images/white.webp
|
||||||
https://boof.eu.org/other/school/presentation 1/
|
https://boof.eu.org/other/school/presentation 1/
|
||||||
https://boof.eu.org/other/school/presentation 1/style.css
|
https://boof.eu.org/other/school/presentation 1/style.css
|
||||||
|
https://boof.eu.org/other/tensor/test1/
|
||||||
|
https://boof.eu.org/other/tensor/test1/script.js
|
||||||
https://boof.eu.org/tools/Btorrent/views/download.html
|
https://boof.eu.org/tools/Btorrent/views/download.html
|
||||||
https://boof.eu.org/tools/Btorrent/views/full.html
|
https://boof.eu.org/tools/Btorrent/views/full.html
|
||||||
https://boof.eu.org/tools/Btorrent/views/view.html
|
https://boof.eu.org/tools/Btorrent/views/view.html
|
||||||
@ -5278,6 +5295,13 @@ https://boof.eu.org/Games/sm64/assets/images/MrIncredible.jpg
|
|||||||
https://boof.eu.org/other/nostalgia/old movies and videos/karius/
|
https://boof.eu.org/other/nostalgia/old movies and videos/karius/
|
||||||
https://boof.eu.org/other/nostalgia/old movies and videos/karius/index.js
|
https://boof.eu.org/other/nostalgia/old movies and videos/karius/index.js
|
||||||
https://boof.eu.org/other/nostalgia/old movies and videos/karius/torrent.js
|
https://boof.eu.org/other/nostalgia/old movies and videos/karius/torrent.js
|
||||||
|
https://boof.eu.org/other/tensor/test1/model/group1-shard1of6.bin
|
||||||
|
https://boof.eu.org/other/tensor/test1/model/group1-shard2of6.bin
|
||||||
|
https://boof.eu.org/other/tensor/test1/model/group1-shard3of6.bin
|
||||||
|
https://boof.eu.org/other/tensor/test1/model/group1-shard4of6.bin
|
||||||
|
https://boof.eu.org/other/tensor/test1/model/group1-shard5of6.bin
|
||||||
|
https://boof.eu.org/other/tensor/test1/model/group1-shard6of6.bin
|
||||||
|
https://boof.eu.org/other/tensor/test1/model/model.json
|
||||||
https://boof.eu.org/Games/Hextris/style/fa/css/font-awesome.css
|
https://boof.eu.org/Games/Hextris/style/fa/css/font-awesome.css
|
||||||
https://boof.eu.org/Games/Hextris/style/fa/css/font-awesome.min.css
|
https://boof.eu.org/Games/Hextris/style/fa/css/font-awesome.min.css
|
||||||
https://boof.eu.org/Games/Hextris/style/fa/fonts/FontAwesome.otf
|
https://boof.eu.org/Games/Hextris/style/fa/fonts/FontAwesome.otf
|
||||||
|
|||||||
@ -245,6 +245,10 @@
|
|||||||
<lastmod>2023-04-16T01:13:54+02:00</lastmod>
|
<lastmod>2023-04-16T01:13:54+02:00</lastmod>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
|
<loc>https://boof.eu.org/other/ow-map/</loc>
|
||||||
|
<lastmod>2023-09-11T14:28:29+02:00</lastmod>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
<loc>https://boof.eu.org/other/urls to array/</loc>
|
<loc>https://boof.eu.org/other/urls to array/</loc>
|
||||||
<lastmod>2023-04-28T10:24:18+02:00</lastmod>
|
<lastmod>2023-04-28T10:24:18+02:00</lastmod>
|
||||||
</url>
|
</url>
|
||||||
@ -361,6 +365,10 @@
|
|||||||
<lastmod>2023-04-24T13:26:24+02:00</lastmod>
|
<lastmod>2023-04-24T13:26:24+02:00</lastmod>
|
||||||
</url>
|
</url>
|
||||||
<url>
|
<url>
|
||||||
|
<loc>https://boof.eu.org/other/tensor/test1/</loc>
|
||||||
|
<lastmod>2023-09-11T12:25:24+02:00</lastmod>
|
||||||
|
</url>
|
||||||
|
<url>
|
||||||
<loc>https://boof.eu.org/tools/Btorrent/views/download.html</loc>
|
<loc>https://boof.eu.org/tools/Btorrent/views/download.html</loc>
|
||||||
<lastmod>2022-11-03T08:09:58+01:00</lastmod>
|
<lastmod>2022-11-03T08:09:58+01:00</lastmod>
|
||||||
</url>
|
</url>
|
||||||
|
|||||||