-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/light-adjustment-gpu-2023.1.1'
- Loading branch information
Showing
53 changed files
with
3,594 additions
and
2,513 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["biomejs.biome"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"[javascript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[javascriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"editor.codeActionsOnSave": { | ||
"quickfix.biome": "explicit", | ||
"source.organizeImports.biome": "explicit" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.4.0/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true | ||
} | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"formatWithErrors": false, | ||
"ignore": [], | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineWidth": 100 | ||
}, | ||
"json": { | ||
"parser": { | ||
"allowComments": true | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineWidth": 100 | ||
} | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"enabled": true, | ||
"quoteStyle": "single", | ||
"jsxQuoteStyle": "double", | ||
"trailingComma": "all", | ||
"semicolons": "asNeeded", | ||
"arrowParentheses": "always", | ||
"indentStyle": "space", | ||
"indentWidth": 2, | ||
"lineWidth": 100, | ||
"quoteProperties": "asNeeded" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Media Processors: ライト調整(GPU) + 仮想背景</title> | ||
</head> | ||
<h1>Media Processors: ライト調整(GPU) + 仮想背景</h1> | ||
|
||
<h2>左: 処理後の映像、右: オリジナル映像</h2> | ||
ライト調整: フレーム処理時間: <span id="elapsed0">0.0</span> 秒 フレームレート: <span id="fps0">0.0</span>FPS<br /> | ||
仮想背景: フレーム処理時間: <span id="elapsed1">0.0</span> 秒 フレームレート: <span id="fps1">0.0</span>FPS<br /> | ||
<video id="processedVideo" muted autoplay playsinline></video> | ||
<video id="originalVideo" muted autoplay playsinline></video> | ||
|
||
<script src="./light-adjustment-gpu/light_adjustment_gpu.js"></script> | ||
<script src="./virtual-background/virtual_background.js"></script> | ||
<script> | ||
if (!Shiguredo.VirtualBackgroundProcessor.isSupported() || !Shiguredo.LightAdjustmentGpuProcessor.isSupported()) { | ||
alert("Unsupported platform"); | ||
throw Error("Unsupported platform"); | ||
} | ||
const lightAdjustmentProcessor = new Shiguredo.LightAdjustmentGpuProcessor("./light-adjustment-gpu/", "semantic_guided_llie_648x480", 0.5); | ||
const virtualBackgroundProcessor = new Shiguredo.VirtualBackgroundProcessor("./virtual-background/"); | ||
setInterval(() => { | ||
const elapsed0 = lightAdjustmentProcessor.getAverageProcessedTimeMs() / 1000; | ||
document.getElementById('elapsed0').innerText = elapsed0.toFixed(4).padStart(4, '0'); | ||
const fps0 = lightAdjustmentProcessor.getFps(); | ||
document.getElementById('fps0').innerText = fps0.toFixed(2).padStart(5, '0'); | ||
const elapsed1 = virtualBackgroundProcessor.getAverageProcessedTimeMs() / 1000; | ||
document.getElementById('elapsed1').innerText = elapsed1.toFixed(4).padStart(4, '0'); | ||
const fps1 = virtualBackgroundProcessor.getFps(); | ||
document.getElementById('fps1').innerText = fps1.toFixed(2).padStart(5, '0'); | ||
}, 300); | ||
|
||
function getUserMedia() { | ||
const constraints = { | ||
width: 320, | ||
height: 240, | ||
}; | ||
return navigator.mediaDevices.getUserMedia({video: constraints}); | ||
} | ||
|
||
getUserMedia().then(async (stream) => { | ||
const backgroundImage = new Image(); | ||
backgroundImage.src = 'background.jpg'; | ||
|
||
const originalTrack = stream.getVideoTracks()[0]; | ||
const processedTrack0 = await lightAdjustmentProcessor.startProcessing(originalTrack); | ||
const processedTrack1 = await virtualBackgroundProcessor.startProcessing(processedTrack0, {backgroundImage}); | ||
|
||
document.getElementById("originalVideo").srcObject = new MediaStream([originalTrack]); | ||
document.getElementById("processedVideo").srcObject = new MediaStream([processedTrack1]); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.