Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- set-location -path "~\pictures\people"
- # Define the folder path
- $folderPath = "~\pictures\people"
- $extension = ".jpeg"
- # https://github.com/LeandroBarone/python-ascii_magic
- # https://pypi.org/project/ascii-magic/
- pip install ascii_magic
- #skip the rename
- if ($false) {
- Write-Host "Renaming existing photos with random names"
- # Get all .jpeg files in the folder
- Get-ChildItem -Path $folderPath -Filter *.jpeg | ForEach-Object {
- $randomName = [System.IO.Path]::ChangeExtension([System.IO.Path]::GetRandomFileName(), $extension)
- # Rename the file
- Rename-Item -Path $_.FullName -NewName $randomName
- }
- }
- while ($true) {
- $randomName = [System.IO.Path]::ChangeExtension([System.IO.Path]::GetRandomFileName(), $extension)
- Write-Host "Downloading new person to filename: $randomName"
- Invoke-WebRequest -Uri https://thispersondoesnotexist.com/ -OutFile $randomName
- $file = Get-Item $randomName
- $size = $file.Length
- Write-Host "$size bytes downloaded"
- # Preview in ASCII Art
- python -c "from ascii_magic import AsciiArt;import sys;art = AsciiArt.from_image('$randomName');art.to_terminal(columns=130)"
- # Sleep for 1 second
- Start-Sleep -Seconds 1
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement