返回资讯中心
外部精选
软件工程
#开发者实时流

Average People in Paintings

Earlier this year I made The Long Walk (of paintings). I had collected some 30,000 paintings from various museums for it. I was inspired to make that after seeing this by John Muyskens. I was looking back it that last w…

Hacker News 最新willmeyers2026/10/23 · 25 天前24 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

Earlier this year I made The Long Walk (of paintings). I had collected some 30,000 paintings from various museums for it. I was inspired to make that after seeing this by John Muyskens. I was looking back it that last week and was reminded of Aleksey Tikhonov's Average Art where he used over 18,000 portraits to construct an average face from them. I wanted to do some analysis over the dataset I had amassed for Long Walk. I ended up down a rabbit hole and expanding my initial dataset to include artworks from Wikidata, Wikimedia Commons, WikiArt, Museum open data, and Zenodo to have over 370,000 paintings. Here is a sliver of analysis I have completed over the course of about a week that I thought was interesting to share.

Then, using similar methods as Tikhonov, I created an average face. You can scroll through time and see how it changes.

Looking at the data, the number of faces in paintings decreases over time.

I thought that was interesting (since the trend also started before the invention of photography). What about people in general? Do people and figures follow the same trend?

They do. As I was pouring through samples of different figures, I noticed their poses changed over time. And that's where this rabbit hole starts.

To find the poses I ran a pose model (ViTPose) over every person detected in the paintings. It places 17 points on a body: the nose, eyes and ears, shoulders, elbows, wrists, hips, knees and ankles.

Running that over the course of a full day on my laptop gave me 278,164 figures, and 261,750 of them were clear enough to sort into one of twelve kinds of pose, from standing and facing out to lying down. Grouped together they make five families: standing still, seated, leaning or bending, an arm raised, and crouching, fallen or lying.

Standing still is the most common pose by far, but not by the same amount in every century. In the 1400s, 61% of figures are standing still. By around 1580 that falls to about 42% while leaning and bending peak, and by 1900 it's back near 60%.

It should be said that this pose model is not perfect! Especially when it comes to detecting poses in paintings of all things. But looking through samples myself I considered it good enough.

I then applied the same averaging to poses.

On the left, every figure in that pose from the fifty years around the year is warped onto the same skeleton and averaged together. On the right are the same figures drawn as stick figures.

With this skeleton pose dataset, we can now search for a specific pose and get figures that kind of match it. What if you created an animation of poses and created an average figure for each frame?

That's pretty cool in my opinion. CMU motion capture database has recordings of people walking, bowing, waving, sitting down, dancing, boxing and doing cartwheels. I applied them to the paintings as well. Some of these looked a bit cursed, but still, I think this is interesting.

Of course, if you can animate it you can control it. I cut walk, jump and punch from the motion capture into short loops to create spritesheets for a small game. Here's a simple beat 'em up game:

If you're interested in the data, you can email me and I can figure out a way to get you access.

',u.append(Object.assign(document.createElement("div"),{className:"help",textContent:s.game.help}));const b=Object.assign(document.createElement("div"),{className:"pad"});f.append(b),me(u,s.game.caption);const d=je;xe(u,()=>Promise.all([d(e+"22_sprites.webp"+c),d(e+"22_backdrop.png"+c),fetch(e+"22_sprites.json"+c).then(v=>v.json())]).then(([v,A,E])=>{const r=400/E.frame[1],[y,T]=E.frame,l=E.anims,L=E.torso_pxr;l.getup={...l.fall,reverse:!0};const k=E.periods.map(t=>({...t,sheet:null,loading:!1})),M=t=>{const m=k[t];m&&!m.loading&&(m.loading=!0,d(e+m.file+c).then(n=>m.sheet=n).catch(()=>{m.loading=!1}))};M(0),M(1);const R=2.6L,J=1.6,ie={after:.34,from:.08},ne=.18,S=.22,H=1.7L,X=5L,F=5,w=.8,D=3.2,x=l.fall.frames/l.fall.fps,z=[{need:5,most:1,rate:.55,cool:1.6,hp:2,every:2.6},{need:5,most:2,rate:.6,cool:1.4,hp:2,every:2.3},{need:6,most:2,rate:.65,cool:1.25,hp:2,every:2},{need:6,most:3,rate:.7,cool:1.1,hp:2,every:1.8},{need:7,most:3,rate:.78,cool:.95,hp:3,every:1.5},{need:1/0,most:4,rate:.9,cool:.75,hp:3,every:1.1}],se=.9,V=2.4,C=h.getContext("2d"),Q=new Set,te=Object.assign(document.createElement("canvas"),{width:y,height:T}),ee=te.getContext("2d");function O(){const t=Math.min(devicePixelRatio||1,matchMedia("(pointer: coarse)").matches?1.5:2);h.width=Math.round(h.clientWidtht),h.height=Math.round(h.clientWidtht400/960)}new ResizeObserver(O).observe(h),O();const N=(t,m,n)=>({x:t,face:m,anim:"idle",t:0,rate:1,lift:0,vx:0,alpha:1,prev:null,since:1,flash:0,sheet:v,...n}),o=N(960/2,1,{hp:F,inv:0,alpha:0});let Z=[],G=0,ae=0,le=1.2,ce=0,re=0,Ae=0,he=V;const Oe=()=>z[Math.min(re,z.length-1)],Be=()=>k[re].sheet||v;function Ye(){re++,Ae=0,he=V,o.hp=Math.min(F,o.hp+1),M(re+1);for(const t of Z)t.dead||(t.from=t.sheet,t.sheet=Be(),t.morph=0)}const oe=(t,m)=>{t.prev={anim:t.anim,t:t.t},t.since=0,t.anim=m,t.t=0,t.struck=!1},Re=()=>o.anim==="jump"||o.anim==="hit",Ge=t=>Math.max(yr*.25,Math.min(960-yr.25,t));function He(t,m){if(m.vx=t.faceX,m.flash=.09,m===o){o.hp--,o.inv=1,o.hp{n.dead=!0,n.gone=!0}));return}--m.hp=Oe().need&&re0?0:(Q.has("ArrowRight")?1:0)-(Q.has("ArrowLeft")?1:0);ceie.after&&(oe(o,"hit"),o.t=ie.from)),o.t+=t;const n=l[o.anim],P=Math.floor(o.tn.fps);if(o.anim!=="hit"&&m&&(o.face=m,o.x+=mRt),o.x=Ge(o.x+o.vxt),o.vx=Math.exp(-t6),o.anim==="jump"){const I=n.lift,q=Math.min(I.length-1,o.tn.fps),U=Math.floor(q);o.lift=(I[U]+(I[Math.min(I.length-1,U+1)]-I[U])(q-U))J}else o.lift=0;if(o.anim==="hit"&&!o.struck&&o.t>=S){o.struck=!0;for(const I of Z){const q=(I.x-o.x)o.face;!I.dead&&q>-.2L&&q=n.frames?oe(o,o.anim==="jump"?"land":m?"walk":"idle"):o.anim==="idle"&&m?oe(o,"walk"):o.anim==="walk"&&!m&&oe(o,"idle"),o.inv-=t,ce>0&&(ce-=t,ce!I.dead).length=P.frames;if(n.x+=n.vxt,n.vx=Math.exp(-t6),n.since+=t,n.from&&(n.morph=Math.min(1,n.morph+t/se)),n.dead){(n.gone||n.t>x+w)&&(n.alpha-=t1.4);continue}if(n.alpha=Math.min(1,n.alpha+t2),n.stun>0){n.stun-=t,n.stun=S&&(n.struck=!0,ce-.2L&&U0)&&(n.face=q>0?1:-1,U>H*.8?(n.anim!=="walk"&&oe(n,"walk"),n.x+=n.faceRn.ratet):(n.anim==="walk"&&oe(n,"idle"),(n.cool-=t)n.alpha>0||!n.dead);const m=Z.filter(n=>!n.dead).sort((n,P)=>n.x-P.x);for(let n=1;nI.loop?ge%I.frames:I.reverse?Math.max(0,I.frames-1-ge):Math.min(I.frames-1,ge);return P.push([I.row,we(U),n(1-ue)],[I.row,we(U+1),nue]),P}function ze(t){const m=t.prev?Math.min(1,t.since/ne):1,n=mm*(3-2m),P=Pe(t.anim,t.t,n,[]);n.002&&(ee.globalAlpha=uege,ee.drawImage(we,Uy,qT,y,T,0,0,y,T));return I>=1&&(t.from=null),ee.globalCompositeOperation="source-atop",t.flash>0&&(ee.globalAlpha=.55,ee.fillStyle="#f4e6cf",ee.fillRect(0,0,y,T)),ee.globalCompositeOperation="source-over",ee.globalAlpha=1,te}function We(t,m){const n=t.liftL,P=t.anim==="idle"?1+Math.sin(t.t2.4).006:1,I=Math.max(0,t.alpha);C.globalAlpha=I(t===o&&o.inv>0&&ce=k.length-1;if(C.globalAlpha=1,C.textAlign="center",C.fillText((s.game.era,{era:P}),960/2,32n),!I){const q=160n,U=42n;C.globalAlpha=.25,C.fillRect(960/2-q/2,U,q,4n),C.globalAlpha=.9,C.fillRect(960/2-q/2,U,qAe/Oe().need,4n)}he>0&&ce0&&(C.globalAlpha=1,C.font="600 22px Verdana, sans-serif",C.fillText((s.game.down,{era:k[re].start}),960/2,400*.42)),C.globalAlpha=1,C.shadowBlur=0,C.textAlign="left"}let Ce=0,Le=0,Te=!1;function _e(t){const m=Math.min(.05,(t-(Ce||t))/1e3);Ce=t,u.classList.contains("playing")?(Je(m),Ke(m),o.since+=m):o.alpha=Math.min(1,o.alpha+m*1.5),Qe(m),Le=Te?requestAnimationFrame(_e):0}new IntersectionObserver(([t])=>{Te=t.isIntersecting,Te&&!Le&&(Ce=0,Le=requestAnimationFrame(_e))}).observe(h);const De={ArrowLeft:"ArrowLeft",ArrowRight:"ArrowRight"," ":" ",Spacebar:" ",x:"x",X:"x"};f.addEventListener("keydown",t=>{const m=De[t.key];m&&(t.preventDefault(),Q.add(m))}),f.addEventListener("keyup",t=>{const m=De[t.key];m&&Q.delete(m)}),f.addEventListener("focusin",()=>u.classList.add("playing")),f.addEventListener("focusout",t=>{f.contains(t.relatedTarget)||(u.classList.remove("playing"),Q.clear())}),j.onclick=()=>h.focus();for(const t of[[["ArrowLeft",s.game.buttons.left,"\u25C0"],["ArrowRight",s.game.buttons.right,"\u25B6"]],[[" ",s.game.buttons.jump],["x",s.game.buttons.hit]]]){const m=document.createElement("div");b.append(m);for(const[n,P,I]of t){const q=Object.assign(document.createElement("button"),{textContent:I||P,className:I?"arrow":"",tabIndex:-1});q.setAttribute("aria-label",P),m.append(q),q.addEventListener("pointerdown",U=>{U.preventDefault(),f.contains(document.activeElement)||h.focus({preventScroll:!0});try{q.setPointerCapture(U.pointerId)}catch{}Q.add(n),q.classList.add("down")});for(const U of["pointerup","pointercancel","lostpointercapture"])q.addEventListener(U,()=>{Q.delete(n),q.classList.remove("down")});q.addEventListener("contextmenu",U=>U.preventDefault())}}const Ze=()=>f.classList.contains("is-full");function $e(t){f.classList.toggle("is-full",t),g.setAttribute("aria-label",t?s.game.buttons.exit:s.game.buttons.full),g.innerHTML=t?'':'',h.focus({preventScroll:!0})}g.addEventListener("pointerdown",t=>t.preventDefault()),g.onclick=async()=>{const t=f.requestFullscreen||f.webkitRequestFullscreen,m=document.exitFullscreen||document.webkitExitFullscreen;if(Ze()){document.fullscreenElement||document.webkitFullscreenElement?m.call(document):$e(!1);return}try{await t.call(f),window.screen.orientation?.lock?.("landscape").catch(()=>{})}catch{$e(!0)}};for(const t of["fullscreenchange","webkitfullscreenchange"])document.addEventListener(t,()=>$e((document.fullscreenElement||document.webkitFullscreenElement)===f))}).catch(v=>console.warn("game:",v)))}})();

#featured

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →