@rr0/ufoathome 0.178.0 → 0.178.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist-embed-scene/GenerativeKit-BmhvjjzB.js +9 -0
  2. package/dist-embed-scene/{GenerativeKitMessages-Cu7wXgYa.js → GenerativeKitMessages-7-3kT9Ef.js} +1 -1
  3. package/{dist-embed-sighting/GenerativeKitMessages_en-Cl3kA96x.js → dist-embed-scene/GenerativeKitMessages_en-BY4B6yas.js} +3 -2
  4. package/{dist-embed-sighting-editor/GenerativeKitMessages_es-CEU93Cl3.js → dist-embed-scene/GenerativeKitMessages_es-_iYkoRhK.js} +3 -2
  5. package/dist-embed-scene/{GenerativeKitMessages_fr-DmW0OAmF.js → GenerativeKitMessages_fr-BY5yUJwK.js} +3 -2
  6. package/{dist-embed-sighting/GenerativeKitMessages_it-Ba87kumS.js → dist-embed-scene/GenerativeKitMessages_it-DAgB31P1.js} +3 -2
  7. package/dist-embed-scene/rr0-scene.mjs +43 -43
  8. package/dist-embed-sighting/{CaseReportExport-Uf7Bs2Qz.js → CaseReportExport-IaDMFEro.js} +1 -1
  9. package/dist-embed-sighting/GenerativeKit-BmhvjjzB.js +9 -0
  10. package/dist-embed-sighting/{GenerativeKitMessages-BudEc93g.js → GenerativeKitMessages-CRj85mnY.js} +1 -1
  11. package/{dist-embed-scene/GenerativeKitMessages_en-Cl3kA96x.js → dist-embed-sighting/GenerativeKitMessages_en-BY4B6yas.js} +3 -2
  12. package/{dist-embed-scene/GenerativeKitMessages_es-CEU93Cl3.js → dist-embed-sighting/GenerativeKitMessages_es-_iYkoRhK.js} +3 -2
  13. package/{dist-embed-sighting-editor/GenerativeKitMessages_fr-DmW0OAmF.js → dist-embed-sighting/GenerativeKitMessages_fr-BY5yUJwK.js} +3 -2
  14. package/{dist-embed-sighting-editor/GenerativeKitMessages_it-Ba87kumS.js → dist-embed-sighting/GenerativeKitMessages_it-DAgB31P1.js} +3 -2
  15. package/dist-embed-sighting/rr0-sighting.mjs +98 -98
  16. package/dist-embed-sighting-editor/{CaseReportExport-iCzv1W9B.js → CaseReportExport-D0r6soze.js} +1 -1
  17. package/dist-embed-sighting-editor/GenerativeKit-BmhvjjzB.js +9 -0
  18. package/dist-embed-sighting-editor/{GenerativeKitMessages-BNXaLr1m.js → GenerativeKitMessages-BtNG1usJ.js} +1 -1
  19. package/dist-embed-sighting-editor/{GenerativeKitMessages_en-Cl3kA96x.js → GenerativeKitMessages_en-BY4B6yas.js} +3 -2
  20. package/{dist-embed-sighting/GenerativeKitMessages_es-CEU93Cl3.js → dist-embed-sighting-editor/GenerativeKitMessages_es-_iYkoRhK.js} +3 -2
  21. package/{dist-embed-sighting/GenerativeKitMessages_fr-DmW0OAmF.js → dist-embed-sighting-editor/GenerativeKitMessages_fr-BY5yUJwK.js} +3 -2
  22. package/{dist-embed-scene/GenerativeKitMessages_it-Ba87kumS.js → dist-embed-sighting-editor/GenerativeKitMessages_it-DAgB31P1.js} +3 -2
  23. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +61 -61
  24. package/package.json +1 -1
  25. package/dist-embed-scene/GenerativeKit-DR6C3LMC.js +0 -4
  26. package/dist-embed-sighting/GenerativeKit-DR6C3LMC.js +0 -4
  27. package/dist-embed-sighting-editor/GenerativeKit-DR6C3LMC.js +0 -4
@@ -0,0 +1,9 @@
1
+ import{zip as T}from"./browser-CltifEM0.js";import{g as x,V as A,O as $,B as _,M as D,C as H,Q as I}from"./VideoExport-B8ZhHNnd.js";class p{static DEPTH_NEAR_M=1;static DEPTH_FAR_M=2e4;static MASK_MARGIN_PX=4;static depthLevel(e){if(!(e>0))return 0;const t=1-Math.log(e/p.DEPTH_NEAR_M)/Math.log(p.DEPTH_FAR_M/p.DEPTH_NEAR_M);return Math.min(1,Math.max(0,t))}static dilate(e,t,a,c,n=p.MASK_MARGIN_PX){const i=new Uint8Array(e.length);for(let o=0;o<c;o++)for(let r=0;r<a;r++){let s=0;for(let d=-n;d<=n&&!s;d++){const u=r+d;u>=0&&u<a&&e[o*a+u]&&(s=255)}i[o*a+r]=s}for(let o=0;o<c;o++)for(let r=0;r<a;r++){let s=0;for(let d=-n;d<=n&&!s;d++){const u=o+d;u>=0&&u<c&&i[u*a+r]&&(s=255)}t[o*a+r]=s}}}class l{static MAX_CHARS=2500;static NEGATIVE=`added objects, windows, portholes, lights or beams not in the reference, smoke, people, animals, camera shake beyond the reference, lens flares not in the reference, any change of the phenomenon's shape, size, colour, brightness, position or motion, text, logos.
2
+ `;static of(e,t){const a=e,c=t.rate&&t.rate>0?t.rate:1,n=s=>Math.max(0,(s-t.fromSeconds)/c),i=[s=>s,s=>l.firstSentence(s),s=>l.firstWords(l.firstSentence(s),l.SHORT_NOTE_CHARS)];let o="";for(const s of i)if(o=[`Realistic, steady first-person view, as seen by a pedestrian's own eyes, ${a.place?.name??"place not stated"}, local time ${a.time??"not stated"}. Keep exactly the geometry, horizon, framing, lighting and motion of the reference video: only make the textures (vegetation, ground, buildings, clouds, rain) photographic. Render the phenomenon as realistically as the rest (same grain, blur, haze and light), but keep its shape, size, colour, brightness, position and motion exactly those of the reference video.`,"","Phenomenon, as drawn by the reconstruction from the testimony:",...l.shapes(a,t.fromSeconds),...l.section("What happens:",l.milestones(a,t,n,s)),...l.section("Weather and light (follow this, not the reference's own colours):",l.weather(a,t,n))].join(`
3
+ `)+`
4
+ `,o.length<=l.MAX_CHARS)return o;const r=[];for(const s of o.split(`
5
+ `)){if([...r,s].join(`
6
+ `).length+1>l.MAX_CHARS)break;r.push(s)}return r.join(`
7
+ `)+`
8
+ `}static SHORT_NOTE_CHARS=80;static firstSentence(e){const t=e.search(/[.;!?](\s|$)/);return t>=0?e.slice(0,t+1):e}static firstWords(e,t){if(e.length<=t)return e;const a=e.lastIndexOf(" ",t-1);return e.slice(0,a>0?a:t-1)+"…"}static section(e,t){return t.length>0?["",e,...t]:[]}static text(e,t="en"){if(e!==void 0)return typeof e=="string"?e:e[t]??e.en??Object.values(e)[0]}static shapes(e,t){const a=new Map;for(const c of e.timeline?.keyframes??[])for(const n of c.shapes??[])(c.t<=t*1e3||!a.has(n.sourceId))&&a.set(n.sourceId,n.shape);return a.size===0?["- none drawn."]:[...a.entries()].map(([c,n])=>{const i=n.angular?`${n.angular.widthDeg}° wide and ${n.angular.heightDeg}° tall as seen`:"size not stated",o=n.aim?`, at azimuth ${Math.round(n.aim.azimuthDeg)}°, ${n.aim.altitudeDeg.toFixed(1)}° above the horizon`:"";return`- ${l.text(n.title)??c}: colour ${n.color??"not stated"}, ${i}${o}.`})}static milestones(e,t,a,c){return(e.milestones??[]).filter(n=>n.t/1e3>=t.fromSeconds&&n.t/1e3<=t.toSeconds).map(n=>`- ${a(n.t/1e3).toFixed(1)} s into the video: ${c(l.text(n.note)??"")}`)}static weather(e,t,a){const c=(e.tags??[]).length>0?[`- ${(e.tags??[]).join(", ")}.`]:[];let n="";for(const i of e.weatherTrack?.keyframes??[]){const o=i.t/1e3;if(o>t.toSeconds)break;const r=l.describe(i.weather);r!==n&&(n=r,c.push(`- ${o<=t.fromSeconds?"from the start":`from ${a(o).toFixed(1)} s into the video`}: ${r}.`))}return c}static describe(e){const t=[];return typeof e.cloudCover=="number"&&t.push(e.cloudCover>=.95?"overcast":`cloud cover ${Math.round(e.cloudCover*100)} %`),typeof e.cloudBaseM=="number"&&t.push(`cloud base ${Math.round(e.cloudBaseM)} m`),t.push(e.precipitationType&&e.precipitationType!=="none"?`${e.precipitationType}, intensity ${e.precipitationIntensity??"not stated"}`:"no precipitation"),t.join(", ")}}class S{static async make(e,t,a,c){const n=Math.max(2,Math.floor(e.film.width/2)*2),i=Math.max(2,Math.floor(e.film.height/2)*2),o=await x(["avc","vp9","av1"],{width:n,height:i});if(!o)throw new Error(`No video codec for ${n}×${i}`);const r=await Promise.all(["depth","phenomenon-mask","sky-mask"].map(y=>S.passFilm(y,n,i,o))),[s,d,u]=r;let m,M,E=0;try{const y=await A.film({...e.film,frameAt:(f,h,w)=>e.film.frameAt(f,h,w)?(m=e.drawControlPasses(),!0):!1,hearInto:f=>e.film.hearInto(f),afterFrame:async(f,h)=>{if(f===0&&(M=await h.canvas.convertToBlob({type:"image/png"})),!m)throw new Error(`No control passes for frame ${f}`);S.paint(m,s.context,d.context,u.context),m=void 0;for(const w of r)await w.source.add(f/A.FRAME_RATE,1/A.FRAME_RATE);E=f+1}},a,c),g=await Promise.all(r.map(async f=>{await f.output.finalize();const h=f.output.target.buffer;if(!h)throw new Error(`Empty ${f.name} film`);return[f.name,new Uint8Array(h)]}));return await S.zipped(e,t,new Uint8Array(await y.arrayBuffer()),g,M,E)}catch(y){throw await Promise.all(r.map(g=>g.output.cancel().catch(()=>{}))),y}}static async passFilm(e,t,a,c){const n=new OffscreenCanvas(t,a),i=n.getContext("2d");if(!i)throw new Error("No 2D context");i.imageSmoothingEnabled=!1;const o=new $({format:new D({fastStart:"in-memory"}),target:new _}),r=new H(n,{codec:c,quality:I});return o.addVideoTrack(r,{frameRate:A.FRAME_RATE}),await o.start(),{name:e,output:o,source:r,context:i}}static paint(e,t,a,c){const{width:n,height:i}=e,o=n*i,r=new Uint8Array(o);p.dilate(e.phenomenon,r,n,i);const s={depth:new ImageData(n,i),phenomenon:new ImageData(n,i),sky:new ImageData(n,i)};for(let m=0;m<o;m++){const M=e.distanceM[m],E=Math.round(p.depthLevel(M)*255),y=M>0?0:255,g=m*4;for(const[f,h]of[[s.depth.data,E],[s.phenomenon.data,r[m]],[s.sky.data,y]])f[g]=h,f[g+1]=h,f[g+2]=h,f[g+3]=255}const d=new OffscreenCanvas(n,i),u=d.getContext("2d");for(const[m,M]of[[t,s.depth],[a,s.phenomenon],[c,s.sky]])u.putImageData(M,0,0),m.drawImage(d,0,0,m.canvas.width,m.canvas.height)}static zipped(e,t,a,c,n,i){const o=new TextEncoder,r=e.film.fromMs/1e3,s=e.film.toMs/1e3,d=e.film.rate>0?e.film.rate:1,u=Math.round(i/A.FRAME_RATE*10)/10,m=new Date().toISOString().slice(0,10),M={title:e.title,source:e.source??"",date:m,fps:String(A.FRAME_RATE),duration:String(u),near:String(p.DEPTH_NEAR_M),far:String(p.DEPTH_FAR_M),margin:String(p.MASK_MARGIN_PX),maxChars:l.MAX_CHARS.toLocaleString(e.language),label:t.label},E=t.readme.replace(/\{(\w+)\}/g,(h,w)=>M[w]??h),y={title:e.title,source:e.source,madeBy:A.MADE_BY,date:m,clip:{fromSeconds:r/d,toSeconds:s/d,fps:A.FRAME_RATE,frames:i,width:e.film.width,height:e.film.height},depth:{encoding:"1 - ln(d / near) / ln(far / near), clamped to 0..1; 0 for the sky",nearM:p.DEPTH_NEAR_M,farM:p.DEPTH_FAR_M},phenomenonMaskMarginPx:p.MASK_MARGIN_PX,promptMaxChars:l.MAX_CHARS,label:t.label},g={level:0},f={"reference.mp4":[a,g],...Object.fromEntries(c.map(([h,w])=>[`${h}.mp4`,[w,g]])),"prompt.txt":o.encode(l.of(e.recording,{fromSeconds:r,toSeconds:s,rate:d})),"negative-prompt.txt":o.encode(l.NEGATIVE),[t.readmeFile]:o.encode(E),"manifest.json":o.encode(JSON.stringify(y,null,2)+`
9
+ `)};return(async()=>(n&&(f["first-frame.png"]=[new Uint8Array(await n.arrayBuffer()),g]),new Promise((h,w)=>T(f,(R,b)=>R?w(R):h(new Blob([b],{type:"application/zip"}))))))()}}export{S as GenerativeKit};
@@ -1 +1 @@
1
- import{c as r,_ as t}from"./rr0-scene.mjs";const i=r.catalog({en:()=>t(()=>import("./GenerativeKitMessages_en-Cl3kA96x.js"),[],import.meta.url).then(e=>e.generativeKitMessages_en),fr:()=>t(()=>import("./GenerativeKitMessages_fr-DmW0OAmF.js"),[],import.meta.url).then(e=>e.generativeKitMessages_fr),es:()=>t(()=>import("./GenerativeKitMessages_es-CEU93Cl3.js"),[],import.meta.url).then(e=>e.generativeKitMessages_es),it:()=>t(()=>import("./GenerativeKitMessages_it-Ba87kumS.js"),[],import.meta.url).then(e=>e.generativeKitMessages_it)});export{i as generativeKitMessages};
1
+ import{c as r,_ as t}from"./rr0-scene.mjs";const i=r.catalog({en:()=>t(()=>import("./GenerativeKitMessages_en-BY4B6yas.js"),[],import.meta.url).then(e=>e.generativeKitMessages_en),fr:()=>t(()=>import("./GenerativeKitMessages_fr-BY5yUJwK.js"),[],import.meta.url).then(e=>e.generativeKitMessages_fr),es:()=>t(()=>import("./GenerativeKitMessages_es-_iYkoRhK.js"),[],import.meta.url).then(e=>e.generativeKitMessages_es),it:()=>t(()=>import("./GenerativeKitMessages_it-DAgB31P1.js"),[],import.meta.url).then(e=>e.generativeKitMessages_it)});export{i as generativeKitMessages};
@@ -12,13 +12,14 @@ Made with UFO@home (https://ufoathome.org) on {date}.
12
12
  - **depth.mp4**: how far each pixel is, white near, black far and for the sky, on a logarithmic scale from {near} m to {far} m, the same for the whole video.
13
13
  - **phenomenon-mask.mp4**: in white, where the phenomenon the witness described stands, grown by {margin} pixels: what the generated phenomenon must not leave.
14
14
  - **sky-mask.mp4**: in white, the sky.
15
- - **prompt.txt**: the prompt and the negative prompt, written from the recording's own statements only.
15
+ - **prompt.txt**: the prompt, written from the recording's own statements only, {maxChars} characters at most.
16
+ - **negative-prompt.txt**: the negative prompt, what the generator must not do.
16
17
  - **manifest.json**: the provenance and the same information, for a program.
17
18
 
18
19
  ## How to use it
19
20
 
20
21
  1. In the generator, choose a mode that starts from a video ("video to video", "restyle", "modify video"…) and give it reference.mp4. If the video is too long for it, cut it around the moment you want.
21
- 2. Paste the contents of prompt.txt. Set the transformation to the lowest that makes the picture realistic: the geometry, the horizon, the framing and the motion must stay those of the reference.
22
+ 2. Paste prompt.txt into the prompt field, and negative-prompt.txt into the negative prompt's, if there is one. Set the transformation to the lowest that makes the picture realistic: the geometry, the horizon, the framing and the motion must stay those of the reference.
22
23
  3. If the generator takes a depth control video, give it depth.mp4.
23
24
  4. The generator renders the phenomenon too, so that it has the same grain, blur and light as the rest. Then check the result by laying phenomenon-mask.mp4 over the generated video: if the phenomenon leaves it, changes shape, size, colour or motion, or gains details (portholes, lights, reflections), reject the video and start again with a weaker transformation.
24
25
  5. Burn into the whole picture, not into a corner: "{label}".
@@ -12,13 +12,14 @@ Hecho con UFO@home (https://ufoathome.org) el {date}.
12
12
  - **depth.mp4**: la distancia de cada píxel, blanco cerca, negro lejos y para el cielo, en una escala logarítmica de {near} m a {far} m, la misma para todo el vídeo.
13
13
  - **phenomenon-mask.mp4**: en blanco, el lugar del fenómeno descrito por el testigo, ampliado {margin} píxeles: de donde el fenómeno generado no debe salir.
14
14
  - **sky-mask.mp4**: en blanco, el cielo.
15
- - **prompt.txt**: el prompt y el prompt negativo, en inglés, escritos solo a partir de lo que afirma el registro.
15
+ - **prompt.txt**: el prompt, en inglés, escrito solo a partir de lo que afirma el registro, de {maxChars} caracteres como máximo.
16
+ - **negative-prompt.txt**: el prompt negativo, lo que el generador no debe hacer.
16
17
  - **manifest.json**: la procedencia y la misma información, para un programa.
17
18
 
18
19
  ## Modo de empleo
19
20
 
20
21
  1. En el generador, elegir un modo que parta de un vídeo («video to video», «restyle», «modify video»…) y darle reference.mp4. Si el vídeo es demasiado largo para él, cortarlo en torno al momento deseado.
21
- 2. Pegar el contenido de prompt.txt. Ajustar la transformación al mínimo que haga la imagen realista: la geometría, el horizonte, el encuadre y el movimiento deben seguir siendo los de la referencia.
22
+ 2. Pegar prompt.txt en el campo del prompt, y negative-prompt.txt en el del prompt negativo si lo hay. Ajustar la transformación al mínimo que haga la imagen realista: la geometría, el horizonte, el encuadre y el movimiento deben seguir siendo los de la referencia.
22
23
  3. Si el generador acepta un vídeo de control de profundidad («depth»), darle depth.mp4.
23
24
  4. El generador también reproduce el fenómeno, para que tenga el mismo grano, el mismo desenfoque y la misma luz que el resto. Después, controlar el resultado superponiendo phenomenon-mask.mp4 al vídeo generado: si el fenómeno se sale, cambia de forma, tamaño, color o movimiento, o gana detalles (ojos de buey, luces, reflejos), descartar el vídeo y volver a empezar con una transformación más débil.
24
25
  5. Incrustar en toda la imagen, y no en una esquina: «{label}».
@@ -12,13 +12,14 @@ Fait avec UFO@home (https://ufoathome.org) le {date}.
12
12
  - **depth.mp4** : la distance de chaque pixel, blanc près, noir loin et pour le ciel, sur une échelle logarithmique de {near} m à {far} m, la même pour toute la vidéo.
13
13
  - **phenomenon-mask.mp4** : en blanc, la place du phénomène décrit par le témoin, élargie de {margin} pixels : ce dont le phénomène généré ne doit pas sortir.
14
14
  - **sky-mask.mp4** : en blanc, le ciel.
15
- - **prompt.txt** : le prompt et le prompt négatif, en anglais, écrits à partir des seuls énoncés de l'enregistrement.
15
+ - **prompt.txt** : le prompt, en anglais, écrit à partir des seuls énoncés de l'enregistrement, en {maxChars} caractères au plus.
16
+ - **negative-prompt.txt** : le prompt négatif, ce que le générateur ne doit pas faire.
16
17
  - **manifest.json** : la provenance et ces mêmes informations, pour un programme.
17
18
 
18
19
  ## Mode d'emploi
19
20
 
20
21
  1. Dans le générateur, choisir un mode qui part d'une vidéo (« video to video », « restyle », « modify video »…) et y déposer reference.mp4. Si la vidéo est trop longue pour lui, la couper autour du moment voulu.
21
- 2. Coller le contenu de prompt.txt. Régler la transformation au plus bas qui rende l'image réaliste : la géométrie, l'horizon, le cadrage et le mouvement doivent rester ceux de la référence.
22
+ 2. Coller prompt.txt dans le champ du prompt, et negative-prompt.txt dans celui du prompt négatif s'il y en a un. Régler la transformation au plus bas qui rende l'image réaliste : la géométrie, l'horizon, le cadrage et le mouvement doivent rester ceux de la référence.
22
23
  3. Si le générateur accepte une vidéo de contrôle de profondeur (« depth »), lui donner depth.mp4.
23
24
  4. Le générateur rend aussi le phénomène, pour qu'il ait le même grain, le même flou et la même lumière que le reste. Contrôler ensuite le résultat en superposant phenomenon-mask.mp4 à la vidéo générée : si le phénomène en sort, change de forme, de taille, de couleur ou de mouvement, ou gagne des détails (hublots, lumières, reflets), rejeter la vidéo et recommencer avec une transformation plus faible.
24
25
  5. Incruster sur toute l'image, et pas dans un coin : « {label} ».
@@ -12,13 +12,14 @@ Fatto con UFO@home (https://ufoathome.org) il {date}.
12
12
  - **depth.mp4**: la distanza di ogni pixel, bianco vicino, nero lontano e per il cielo, su una scala logaritmica da {near} m a {far} m, la stessa per tutto il video.
13
13
  - **phenomenon-mask.mp4**: in bianco, il posto del fenomeno descritto dal testimone, allargato di {margin} pixel: ciò da cui il fenomeno generato non deve uscire.
14
14
  - **sky-mask.mp4**: in bianco, il cielo.
15
- - **prompt.txt**: il prompt e il prompt negativo, in inglese, scritti solo a partire da ciò che afferma la registrazione.
15
+ - **prompt.txt**: il prompt, in inglese, scritto solo a partire da ciò che afferma la registrazione, di {maxChars} caratteri al massimo.
16
+ - **negative-prompt.txt**: il prompt negativo, ciò che il generatore non deve fare.
16
17
  - **manifest.json**: la provenienza e le stesse informazioni, per un programma.
17
18
 
18
19
  ## Istruzioni
19
20
 
20
21
  1. Nel generatore, scegliere una modalità che parta da un video («video to video», «restyle», «modify video»…) e dargli reference.mp4. Se il video è troppo lungo per esso, tagliarlo attorno al momento voluto.
21
- 2. Incollare il contenuto di prompt.txt. Regolare la trasformazione al minimo che renda l'immagine realistica: la geometria, l'orizzonte, l'inquadratura e il movimento devono restare quelli del riferimento.
22
+ 2. Incollare prompt.txt nel campo del prompt, e negative-prompt.txt in quello del prompt negativo se c'è. Regolare la trasformazione al minimo che renda l'immagine realistica: la geometria, l'orizzonte, l'inquadratura e il movimento devono restare quelli del riferimento.
22
23
  3. Se il generatore accetta un video di controllo della profondità («depth»), dargli depth.mp4.
23
24
  4. Il generatore rende anche il fenomeno, perché abbia la stessa grana, la stessa sfocatura e la stessa luce del resto. Poi controllare il risultato sovrapponendo phenomenon-mask.mp4 al video generato: se il fenomeno ne esce, cambia forma, dimensione, colore o movimento, o acquista dettagli (oblò, luci, riflessi), scartare il video e ricominciare con una trasformazione più debole.
24
25
  5. Sovrimprimere su tutta l'immagine, e non in un angolo: «{label}».