Download ORCASat/ORCASat_CAD/source/make_comparison.py from 5PACE/5PACE3Dmodelsatellites: direct link, hf CLI and curl.
- Browser
- Download file 2.27 kB
-
https://huggingface.co/datasets/5PACE/5PACE3Dmodelsatellites/resolve/main/ORCASat/ORCASat_CAD/source/make_comparison.py
- Command line
-
hf download hf://datasets/5PACE/5PACE3Dmodelsatellites/ORCASat/ORCASat_CAD/source/make_comparison.py
-
curl -L -o make_comparison.py https://huggingface.co/datasets/5PACE/5PACE3Dmodelsatellites/resolve/main/ORCASat/ORCASat_CAD/source/make_comparison.py
2.27 kB
| """Compare supplied video stills with renders of the delivered GLB files.""" | |
| from pathlib import Path | |
| from PIL import Image,ImageOps,ImageDraw,ImageFont | |
| def main(): | |
| root=Path(__file__).resolve().parent.parent/'verification' | |
| font='/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf' | |
| bold='/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf' | |
| title=ImageFont.truetype(bold,35);head=ImageFont.truetype(bold,25);small=ImageFont.truetype(font,21) | |
| w=1680;h=2570;canvas=Image.new('RGB',(w,h),'#edf1f5');d=ImageDraw.Draw(canvas) | |
| d.text((45,32),'ORCASat v2.1 — porównanie z filmem',font=title,fill='#142c44') | |
| d.text((45,86),'Klatki źródłowe i rendery geometrii z wynikowych plików GLB',font=small,fill='#3b526a') | |
| rows=[('Nadir: połączone okno OBC/EPS, strony złączy i USB','16m00s.jpg','v2_1_nadir.png',None,None), | |
| ('Wake: korytarz pomiędzy ogniwami i nośnik magnetometru','08m40s.jpg','v2_1_wake.png',None,None), | |
| ('Zenith od środka: FSS, GNSS i detale tylnej powierzchni','10m20s.jpg','v2_1_zenith_inside.png',None,270), | |
| ('Balast i USB: przesunięta płyta, zlicowane mocowania','12m50s.jpg','v2_1_ballast.png',None,90)] | |
| y=140 | |
| for label,film,model,crop,rotation in rows: | |
| d.rounded_rectangle((30,y,w-30,y+550),radius=15,fill='white') | |
| d.text((50,y+18),label,font=head,fill='#142c44') | |
| d.text((50,y+60),'FILM '+film[:2]+':'+film[3:5],font=small,fill='#42607c') | |
| d.text((860,y+60),'CAD v2.1 / GLB',font=small,fill='#42607c') | |
| f=Image.open(root/'film_reference_frames'/film).convert('RGB') | |
| if crop:f=f.crop(crop) | |
| m=Image.open(root/model).convert('RGB') | |
| if rotation:m=m.rotate(rotation,expand=True) | |
| for im,x in [(f,50),(m,860)]: | |
| im.thumbnail((770,435));canvas.paste(im,(x+(770-im.width)//2,y+100+(435-im.height)//2)) | |
| y+=575 | |
| d.text((45,2470),'Porównanie wizualne; nieudokumentowane wymiary pozostają oszacowane.',font=small,fill='#3b526a') | |
| d.text((45,2505),'Pełne wyniki kontroli: fit_checks.json i validation_report.json w pakiecie.',font=small,fill='#3b526a') | |
| path=root/'Porownanie_v2_1.png';canvas.save(path);Image.open(path).load();print(path,flush=True) | |
| if __name__=='__main__':main() | |