Channel: GeekTips
First time run with medium.en Core ML model took 16 hours just till it started to convert to wave. Then did another 32 hour audiobook but it crashed around 30 hours something. Think it took around 10 or 12 hours to transcribe.
It generates a file about 13GB is my guess based on lost disk space. Where...not sure exactly. Then I wiped it clean (make clean) and updated Mac from Ventura OS 13.4 to 13.5 but that didn't help as second time around it took 17 1/2 hours till it started to convert wave. Then another 10+ hours...and it also crashed at 31 hours and 14 minutes as seen in the screenshot.
It generates a file about 13GB is my guess based on lost disk space. Where...not sure exactly. Then I wiped it clean (make clean) and updated Mac from Ventura OS 13.4 to 13.5 but that didn't help as second time around it took 17 1/2 hours till it started to convert wave. Then another 10+ hours...and it also crashed at 31 hours and 14 minutes as seen in the screenshot.
Say you wanted to invert hex colors so the stroke color is inverted of the fill color. Ultimately I decided against this and just going to use black for stroke. To do so using sed transliterate
sed -e 'y/0123456789abcdef/fedcba9876543210/
' you can't search for a pattern. So perl works in this case.for f in *.svg ; do perl -p -i -e 's{(stroke="#[\w{6}])}{ ($new=$1) =~ tr/0123456789ABCDE/EDCBA9876543210/; $new }eg' "$f" ; done
SVG news
Inkscape 1.3 has been released. Text all on a single path is amazing. Now gonna try some text stroke animations. Previously each letter was it's own path.
https://inkscape.org/doc/release_notes/1.3/Inkscape_1.3.html
Boxy 4.0 (flatpak is free otherwise $40) released a few days ago. Now does basic svg animation. Glaxnimate has some competition now. https://boxy-svg.com/blog/21/boxy-svg-4-released (need to use chrome based browser to view website..drives me bonkers)
Plan on releasing SVG Stroker Fill soon ...Vivus Instant (no javascript just pure CSS / SMIL) for animations you could import any svg as long as it didn't have any fill colors. Well my script allows for fill colors although can't animate the fills (that'd be awesome) but that's what $300/year javascript libraries are for. Anyway can animate the strokes though.
Inkscape 1.3 has been released. Text all on a single path is amazing. Now gonna try some text stroke animations. Previously each letter was it's own path.
https://inkscape.org/doc/release_notes/1.3/Inkscape_1.3.html
Boxy 4.0 (flatpak is free otherwise $40) released a few days ago. Now does basic svg animation. Glaxnimate has some competition now. https://boxy-svg.com/blog/21/boxy-svg-4-released (need to use chrome based browser to view website..drives me bonkers)
Plan on releasing SVG Stroker Fill soon ...Vivus Instant (no javascript just pure CSS / SMIL) for animations you could import any svg as long as it didn't have any fill colors. Well my script allows for fill colors although can't animate the fills (that'd be awesome) but that's what $300/year javascript libraries are for. Anyway can animate the strokes though.
inkscape.org
Inkscape 1.3 Release Notes | Inkscape
svgstrokerfill.zip
3.4 KB
SVG Stroker Fill July 2023...each svg animation is only about 30Kb so super small. Has fill color and animates black strokes in 4 seconds. Only works well with computer generated artwork. Zip file contains SVG Stroker Fill script and svgo config file. Change path accordingly.
Examples are under SVG Stroker Fill section at http://geektips.rf.gd/stickers/
Examples are under SVG Stroker Fill section at http://geektips.rf.gd/stickers/
st=$SECONDS && for f in *.*; do mv "$f" "$RANDOM$RANDOM$RANDOM-$f"; done ; for f in *.pdf ; do pdfimages -j "$f" ./p ; done ; for f in *.* ; do mv "$f" "$(echo "$f" | sed -r 's|(^[0-9]{6})([0-9]+)(.*)|\1\3|')" ; done ; rename 's/\.([^.]+)$/.\L$1/' * ; for f in *.jpeg; do mv "$f" "${f%.jpeg}.jpg" ; done ; for f in *.*; do nf=$(echo "$f" |sed -e 's/[^A-Za-z0-9.-]/_/g;s/\.\.\./_/g;s/\.\./_/g'); test "$f" != "$nf" && mv "$f" "$nf" && echo "$nf"; done ; for f in *.*; do pre="${f%.*}"; suf="${f##*.}"; mv -i -- "$f" "${pre//./_}.${suf}"; done ; rename "s/[_ ]//g" * ; rename 's/^(.{72}).*(\..*)$/$1$2/' * ; mkdir output ; mkdir output/th ; cp *.jpg output/th; cp *.png output/th; cd output/th && imgp -wOcken -q 80 -x 350x350 && cd ../.. && imgp -wOcken -q 95 -x 160x160 && for f in *.jpg; do gmic "$f" fx_graphic_novelfxl 1,2,6,5,20,0,0.62,14,0,1,0.5,0.78,1.92,0,0,0,1,1,1,0.5,0.8,1.28 -o "$f" ; done && for f in *.jpg; do vtracer-linux -i "$f" -o "${f%%.*}.svg" -f 2 -p 7 -g 16 -m polygon; done && nice parallel -j2 --ungroup svgo --config ~/Documents/appimages/svgo.config.js -f {} -o . ::: . && for f in *.svg; do sed -i -E -e 's|([0-9]+\.[0-9]{1})[0-9]+|\1|g' -e 's| (fill)(=\"\#[[:xdigit:]]{6}\")| class="st" \1\2|g' -e 's|(width\=\")([0-9]+)(\" height\=\")([0-9]+)|viewBox\=\"0 0 \2 \4\" class\=\"strokedraw|g' -e 's|(\<path)|\1 pathlength\=\"1\"|g' -e 's|(<\/svg\>)|<style\>\@keyframes doff\{0\%\{stroke-dashoffset\:1\}to\{stroke-dashoffset\:0\}\}<\/style>\1|g' "$f" ; done ; for f in *.svg; do cat dist/top.html >> "${f%.*}".html ; printf "${f%.*} SVG Stroker</title> \n" >> "${f%.*}".html ; cat dist/header.html >> "${f%.*}".html $"$f" ; cat dist/footer.html >> "${f%.*}".html ; done && for i in *.html; do mv "$i" output/th ; done && rm *.jpg ; rm *.svg && cd output/th && cp ../../dist/index.html .. && for f in *.html; do printf "<div class=\"item\"><a href=\"th/"$f"\"><img src=\"th/${f%.*}.jpg\" width=\"$(identify -format "%w" ${f%.*}.jpg)\" height=\"$(identify -format "%h" ${f%.*}.jpg)\" loading=\"lazy\"></div>\n" >> ../index.html ; done && printf "</div>\n</div></body>\n</html>" >> ../index.html && cd ../.. && dt=$( date +%Y_%m_%d_%H_%M_%S) && mkdir output/"$dt" && mkdir output/"$dt"/th && mv output/index.html output/"$dt" && mv output/th/* output/"$dt"/th && rmdir output/th && secs=$((SECONDS-st)); printf 'SVG Stroker took %02dh:%02dm:%02ds\n' $(($secs/3600)) $(($secs%3600/60)) $(($secs%60))
I thought I figured out why whisper.cpp 1.42 would keep crashing. Perhaps it was silence in the audio so I automatically removed it but still it crashed. This is getting quite frustrating. Anyway here's how to automatically remove any silence segments of 4 seconds or more from audio.
it took about an hour to process and showed the following but yet running whisper.cpp on it still crashed
After any silence over 4 seconds was automatically removed which took about an hour to do
Audio became 32:49:17
4 mins and 26 secs was removed of silence. Not sure how many silence parts there actually were.
mkdir output ; for f in *.opus ; do ffmpeg -i "$f" -c:a libopus -vbr off -b:a 32k -ar 48000 -af "silenceremove=start_periods=1:stop_periods=-1:start_threshold=-50dB:stop_threshold=-50dB:start_silence=1:start_duration=2:stop_duration=4:detection=peak",dynaudnorm output/"$f" ; done
it took about an hour to process and showed the following but yet running whisper.cpp on it still crashed
size= 470441kB time=32:49:17.45 bitrate= 32.6kbits/s speed=35.7x
video:0kB audio:461553kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.925659%
Original audio is 32:53:43After any silence over 4 seconds was automatically removed which took about an hour to do
Audio became 32:49:17
4 mins and 26 secs was removed of silence. Not sure how many silence parts there actually were.
just doing an audiobook that is 24:54:11 and of course it crashes at 23h 04 min with only about 2 hours left to do. That was with large model. Now will try with medium I suppose.
[23:03:58.000 --> 23:04:02.000] Wenn wir unter Außenpolitik die Regel des Verhältnisses eines Volkes
[23:04:02.000 --> 23:04:05.000] zur übrigen Welt zu verstehen haben,
zsh: no matches found: *.vtt
sudo pmset -a disablesleep 1disables sleep on mac laptop so you can close the lid and let it continue processing. Sleep will be grayed out in the apple menu.
sudo pmset -a disablesleep 0to allow it to sleep again
edit: update...now it seems if you're on battery power introduced a -b option
dsiplay go to sleep after 15 minutes but computer never sleeps
sudo pmset -b displaysleep 10 sleep 0
# disable sleep when lid closed
sudo pmset -b sleep 0; sudo pmset -b disablesleep 1
# re-enable sleep when lid closed
sudo pmset -b sleep 5; sudo pmset -b disablesleep 0
remove hiss from audio
remove hiss along with taking out any silence 4 seconds or longer (adjust stop_duration)
mkdir output ; for f in *.opus ; do ffmpeg -i "$f" -c:a libopus -vbr off -b:a 32k -af highpass=200,lowpass=3000,afftdn,aformat=channel_layouts=stereo,volume=12dB,dynaudnorm output/"$f" ; done
remove hiss along with taking out any silence 4 seconds or longer (adjust stop_duration)
mkdir output ; for f in *.opus ; do ffmpeg -i "$f" -c:a libopus -vbr off -b:a 32k -af silenceremove=start_periods=1:stop_periods=-1:start_threshold=-50dB:stop_threshold=-50dB:start_silence=1:start_duration=2:stop_duration=4:detection=peakhighpass=200,lowpass=3000,afftdn,aformat=channel_layouts=stereo,volume=12dB,dynaudnorm output/"$f" ; done
However, what if your scanner automatic document feeder only can do duplex (both sides) scanning with letter / A4 paper size. So to scan a book it can only scan in single sides in batch. End up with 2, 4, 6, 8, 10 and then flip them over but when that's done they are reverse 9, 7, 5, 3, 1.
So to rename the files to 1, 3, 5, 7, 9 one can use
So to rename the files to 1, 3, 5, 7, 9 one can use
VSCode
and extension Batch Rename
(JannixX11) by right-clicking on file names in explorer, Text Power Tools
to increment by a starting number, increment by 2, how many times = number of total lines and finally using Transform Reverse Lines
and saving file which renames the files. That's what I ended up doing.Another way using rename add the
-r
option to sort to reverse and remove -n
at rename -n
to not preview results but to actually rename files. Example shows setting starting number to 35 with $i=35 and since it increments by 2 ($i+2) the actually starting number is 37 and it reverses file order. Now you can put all your scans together in proper sequence and make a PDF from your scanned images with ScanTailor Advanced.ls -1 --color=never -c | sort -nr | xargs rename -n 's/.*/our $i; if(!$i) { $i=35 } sprintf("%04d.jpg", $i=$i+2)/e'
Forwarded from SVG Animated Stickers
1) reduced to 1 digit after decimal 215kB 18% less
2) reduced to 3 digits after decimal 261kB
3) reduced to 2 digits after decimal 238kB 9% less
save a bash script called
2) reduced to 3 digits after decimal 261kB
3) reduced to 2 digits after decimal 238kB 9% less
d="M -240.983,-89.522 C -236.461,-123.662 -225.153,-185.011 -176.132,-211.054 -109.389,-246.511 -10.685,
d="M -240.9,-89.5 C -236.4,-123.6 -225.1,-185.0 -176.1,-211.0 -109.3,-246.5 -10.6,
1st shows a SVG partial path of 3 digits after decimal. 2nd one 1 digit.save a bash script called
optimize.sh
with the following:sed -i -E -e 's|([0-9]+\.[0-9]{1})[0-9]+|\1|g' "$1"now run find command and recursively find all svg files
find . -name \*.svg -exec ./optimize.sh {} \;ran it on 17,354 svg files and savings is 800MB. 5GB --> 4.2GB. Sure if did only 2 then 400MB but the glitch as far as I could tell happens less than 0.1% of the time. Not all stickers convert from tgs so it's definitely worth 0.1% stickers getting glitched. Only found glitch on on other sticker. Already reduced to 1 digit for SVG Stroker.
HTML Embed Code: