import{s as Tt,o as Ct,n as $t}from"../chunks/scheduler.7bc62968.js";import{S as Mt,i as _t,g as l,s as o,r as g,A as At,h as s,f as i,c as n,j as bt,u as v,x as m,k as Ge,y as Lt,a,v as w,d as x,t as y,w as b}from"../chunks/index.2f8492b0.js";import{T as kt}from"../chunks/Tip.016f38d9.js";import{H as oe,E as Pt}from"../chunks/EditOnGithub.2a9ce03a.js";function Ht(ie){let r,u=`💡An amazing usecase of multimodal task is Multimodal Emotion Recognition (MER). The MER task involves recognition of emotion from two or more modalities like audio+text, text+vision, audio+vision or vision+text+audio As we discussed in the example, MER is more efficient than unimodal emotion recognition and gives clear insight into the
emotion recognition task. Check out more on MER with <a href="https://github.com/EvelynFan/AWESOME-MER" rel="nofollow">this repository</a>.`;return{c(){r=l("p"),r.innerHTML=u},l(d){r=s(d,"P",{"data-svelte-h":!0}),m(r)!=="svelte-md23vv"&&(r.innerHTML=u)},m(d,h){a(d,r,h)},p:$t,d(d){d&&i(r)}}}function Vt(ie){let r,u='💡Meta released the first multimodal AI model to bind information from 6 different modalities: images and videos, audio, text, depth, thermal, and inertial measurement units (IMUs). Learn more about it <a href="https://imagebind.metademolab.com/" rel="nofollow">here</a>.';return{c(){r=l("p"),r.innerHTML=u},l(d){r=s(d,"P",{"data-svelte-h":!0}),m(r)!=="svelte-19l61l5"&&(r.innerHTML=u)},m(d,h){a(d,r,h)},p:$t,d(d){d&&i(r)}}}function Et(ie){let r,u,d,h,k,ne,$,Ue="Welcome to the chapter on the fundamentals of multimodality. This chapter builds the foundation for the later sections of the unit. We will explore:",le,T,Be="<li>The notion of multimodality, and different sensory inputs humans use for efficient decision making.</li> <li>Why is it important for making innovative applications and services through which we can interact and make lives easier.</li> <li>Multimodality in context to Deep Learning, data, tasks, and models.</li> <li>Related applications like multimodal emotion recognition and multimodal search.</li>",se,C,Qe="So let’s begin 🤗",me,M,re,_,Fe="A modality means a medium or a way in which something exists or is done. In our daily lives, we come across many scenarios where we have to make decisions and perform tasks. For this, we use our 5 sense organs (eyes to see, ears to hear, nose to smell, tongue to taste, and skin to touch). Based on the information from all sense organs, we assess our environment, perform tasks, and make decisions for our survival. Each of these 5 sense organs is a different modality through which information comes to us and thus the word multimodality or multimodal.",de,A,Ne="Think about this scenario for a moment, on a windy night you hear an eerie sound while you are on your bed 👻😨. You feel a bit scared, as you are unaware about the source of the sound. You try to gather some courage and check your environment but you are unable to figure this out 😱. Daringly, you turn on the lights and you find out that it was just your window which was half-opened through which the wind was blowing and making the sound in the first place 😒.",ue,L,Ye=`So what just happened here? Initially you had restricted understanding of the situation due to your limited knowledge of the environment. This limited knowledge was due to the fact because you were just relying on your ears (the eerie sound), to make sense. But as soon as you turned on the lights in the room and looked around through your eyes (added another sense organ), you had a better understanding about the whole situation. As we kept on adding modalities our understanding of the situation became better and clearer than before, for the same scenario, this suggests that adding more modalities to the same situation assist each other and improves the information content.
Even while taking this course and moving ahead, would you not like cool infographics, accompanied by video content explaining minute concepts instead of just plain textual content 😉
Here you go:`,he,P,Je='<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/multimodal_fusion_text_vision/multimodal_elephant.png" alt="Multimodality Notion"/>',fe,H,Ke="<em>An infographic on multimodality and why it is important to capture the overall sense of data through different modalities. The infographic is multimodal as well (image + text).</em>",pe,V,Xe=`Many times communication between 2 people gets really awkward in textual mode, slightly improves when voices are involved but greatly improves when you are able to visualize body language and facial expressions as well. This has been studied in detail by the American Psychologist, Albert Mehrabian who stated this as the 7-38-55 rule of communication, the rule states:
“In communication, 7% of the overall meaning is conveyed through verbal mode (spoken words), 38% through voice and tone and 55% through body language and facial expressions.”`,ce,E,Ze=`To be more general, in the context of AI, 7% of the meaning conveyed is through textual modality, 38% through audio modality and 55% through vision modality.
Within the context of deep learning, we would refer each modality as a way data arrives to a deep learning model for processing and predictions. The most commonly used modalities in deep learning are: vision, audio and text. Other modalities can also be considered for specific use cases like LIDAR, EEG Data, eye tracking data etc.`,ge,I,et=`Unimodal models and datasets are purely based on a single modality, and have been studied for long with many tasks and benchmarks but are limited in their capabilities. Relying on a single modality might not give us the complete picture, and combining more modalities will increase the information content and reduce the possibility of missing cues that might be in them.
For the machines around us to be more intelligent, better at communicating with us and have enhanced interpretation and reasoning capabilities, it is important to build applications and services around models and datasets that are multimodal in nature. Because, multimodality can give us a clearer and more accurate representation of the world around us enabling us to develop applications that are closer to the real-world scenarios.`,ve,S,tt="<strong>Common combinations of modalities and real life examples:</strong>",we,j,it="<li>Vision + Text : Infographics, Memes, Articles, Blogs.</li> <li>Vision + Audio: A Skype call with your friend, dyadic conversations.</li> <li>Vision + Audio + Text: Watching YouTube videos or movies with captions, social media content in general is multimodal.</li> <li>Audio + Text: Voice notes, music files with lyrics</li>",xe,D,ye,R,at="A dataset consisting of multiple modalities is a multimodal dataset. Out of the common modality combinations let us see some examples:",be,W,ot='<li>Vision + Text: <a href="https://visionandlanguage.net/VIST/" rel="nofollow">Visual Storytelling Dataset</a>, <a href="https://visualqa.org/download.html" rel="nofollow">Visual Question Answering Dataset</a>, <a href="https://laion.ai/blog/laion-5b/" rel="nofollow">LAION-5B Dataset</a>.</li> <li>Vision + Audio: <a href="https://www.robots.ox.ac.uk/~vgg/data/vggsound/" rel="nofollow">VGG-Sound Dataset</a>, <a href="https://zenodo.org/records/1188976" rel="nofollow">RAVDESS Dataset</a>, <a href="https://www.avid.wiki/Main_Page" rel="nofollow">Audio-Visual Identity Database (AVID)</a>.</li> <li>Vision + Audio + Text: <a href="https://diuf.unifr.ch/main/diva/recola/" rel="nofollow">RECOLA Database</a>, <a href="https://sail.usc.edu/iemocap/" rel="nofollow">IEMOCAP Dataset</a>.</li>',ke,O,nt=`Now let us see what kind of tasks can be performed using a multimodal dataset? There are many examples, but we will focus generally on tasks that contains the visual and textual
A multimodal dataset will require a model which is able to process data from multiple modalities, such a model is a multimodal model.`,$e,q,Te,z,lt=`Each modality has different tasks related to it, for example: vision downstream tasks contain image classification, image segmentation, object detection etc. and we would be using
models specifically designed for these tasks. So tasks and models go hand in hand. If a task involves two or more modalities then it can be termed as a multimodal task. If we consider a task in terms of inputs and outputs, a multimodal task can generally be thought of as a single input/output arrangement with two different modalities at input and output ends respectively.`,Ce,G,st="Hugging Face supports a wide variety of multimodal tasks. Let us look into some of them.",Me,U,mt="<strong>Some multimodal tasks supported by 🤗 and their variants:</strong>",_e,B,rt="<li>Vision + Text:</li>",Ae,Q,dt='<li><a href="https://huggingface.co/tasks/visual-question-answering" rel="nofollow">Visual Question Answering or VQA</a>: Aiding visually impaired persons, efficient image retrieval, video search, Video Question Answering, Document VQA.</li> <li><a href="https://huggingface.co/tasks/image-to-text" rel="nofollow">Image to Text</a>: Image Captioning, Optical Character Recognition (OCR), Pix2Struct.</li> <li><a href="https://huggingface.co/tasks/text-to-image" rel="nofollow">Text to Image</a>: Image Generation</li> <li><a href="https://huggingface.co/tasks/text-to-video" rel="nofollow">Text to Video</a>: Text-to-video editing, Text-to-video search, Video Translation, Text-driven Video Prediction.</li>',Le,f,ut="<li>Audio + Text:</li>",Pe,F,ht='<li><a href="https://huggingface.co/tasks/automatic-speech-recognition" rel="nofollow">Automatic Speech Recognition</a> (or Speech to Text): Virtual Speech Assistants, Caption Generation.</li> <li><a href="https://huggingface.co/tasks/text-to-speech" rel="nofollow">Text to Speech</a>: Voice assistants, Announcement Systems.</li>',He,p,Ve,N,ft='<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/multimodal_fusion_text_vision/Multimodal.jpg" alt="Multimodal model flow"/>',Ee,Y,pt=`A multimodal model, is a model that can be used to perform multimodal tasks by processing data coming from multiple modalities at the same time. These models combine the uniqueness and strengths of different modalities to make a complete representation of data enhancing the performance on multiple tasks. Multimodal models are trained to integrate and process data from sources like images, videos, text, audio etc.
The process of combining these modalities begins with multiple unimodal models. The outputs of these unimodal models (encoded data) are then fused using a strategy by the fusion module. The strategy of fusion can be early fusion, late fusion or hybrid fusion. The overall task of the fusion module is to make a combined representation of the encoded data from the unimodal models. Finally, a classification network takes up the fused representation to make predictions.`,Ie,J,ct="A detailed section on multimodal tasks and models with a focus on Vision and Text, will be discussed in the next chapter.",Se,K,je,X,gt=`Internet search was the one key advantage Google had, but with the introduction of ChatGPT by OpenAI, Microsoft started out with
powering up their Bing search engine so that they can crush the competition. It was only restricted initially to LLMs, looking into large corpus of text data but the world around us, mainly social media content, web articles and all possible form of online content is largely multimodal. When we search about an image, the image pops up with a corresponding text to describe it. Won’t it be super cool to have another powerful multimodal model which involved both Vision and Text at the same time? This can revolutionize the search landscape hugely, and the core tech involved in this is multimodal learning. We know that many companies also have a large database which is multimodal and mostly unstructured in nature. Multimodal models might help companies with internal search, interactive documentation (chatbots), and many such use cases. This is another domain of Enterprise AI where we leverage AI for organizational intelligence.`,De,Z,vt="Vision Language Models (VLMs) are models that can understand and process both vision and text modalities. The joint understanding of both modalities lead VLMs to perform various tasks efficiently like Visual Question Answering, Text-to-image search etc. VLMs thus can serve as one of the best candidates for multimodal search. So overall, VLMs should find some way to map text and image pairs to a joint embedding space where each text-image pair is present as an embedding. We can perform various downstream tasks using these embeddings, which can also be used for search. The idea of such a joint space is that image and text embeddings that are similar in meaning will lie close together, enabling us to do searches for images based on text (text-to-image search) or vice-versa.",Re,c,We,ee,wt="After going through the fundamentals for multimodality, let’s now take a look into different multimodal tasks and models available in 🤗 and their applications via cool demos and Spaces.",Oe,te,qe,ae,ze;return k=new oe({props:{title:"A Multimodal World",local:"a-multimodal-world",headingTag:"h1"}}),M=new oe({props:{title:"What is Multimodality? 📸📝🎵",local:"what-is-multimodality-",headingTag:"h2"}}),D=new oe({props:{title:"Multimodal Datasets",local:"multimodal-datasets",headingTag:"h2"}}),q=new oe({props:{title:"Multimodal Tasks and Models",local:"multimodal-tasks-and-models",headingTag:"h2"}}),p=new kt({props:{$$slots:{default:[Ht]},$$scope:{ctx:ie}}}),K=new oe({props:{title:"An application of multimodality: Multimodal Search 🔎📲💻",local:"an-application-of-multimodality-multimodal-search-",headingTag:"h2"}}),c=new kt({props:{$$slots:{default:[Vt]},$$scope:{ctx:ie}}}),te=new Pt({props:{source:"https://github.com/johko/computer-vision-course/blob/main/chapters/en/unit4/multimodal-models/a_multimodal_world.mdx"}}),{c(){r=l("meta"),u=o(),d=l("p"),h=o(),g(k.$$.fragment),ne=o(),$=l("p"),$.textContent=Ue,le=o(),T=l("ul"),T.innerHTML=Be,se=o(),C=l("p"),C.textContent=Qe,me=o(),g(M.$$.fragment),re=o(),_=l("p"),_.textContent=Fe,de=o(),A=l("p"),A.textContent=Ne,ue=o(),L=l("p"),L.textContent=Ye,he=o(),P=l("p"),P.innerHTML=Je,fe=o(),H=l("p"),H.innerHTML=Ke,pe=o(),V=l("p"),V.textContent=Xe,ce=o(),E=l("p"),E.textContent=Ze,ge=o(),I=l("p"),I.textContent=et,ve=o(),S=l("p"),S.innerHTML=tt,we=o(),j=l("ul"),j.innerHTML=it,xe=o(),g(D.$$.fragment),ye=o(),R=l("p"),R.textContent=at,be=o(),W=l("ul"),W.innerHTML=ot,ke=o(),O=l("p"),O.textContent=nt,$e=o(),g(q.$$.fragment),Te=o(),z=l("p"),z.textContent=lt,Ce=o(),G=l("p"),G.textContent=st,Me=o(),U=l("p"),U.innerHTML=mt,_e=o(),B=l("ol"),B.innerHTML=rt,Ae=o(),Q=l("ul"),Q.innerHTML=dt,Le=o(),f=l("ol"),f.innerHTML=ut,Pe=o(),F=l("ul"),F.innerHTML=ht,He=o(),g(p.$$.fragment),Ve=o(),N=l("p"),N.innerHTML=ft,Ee=o(),Y=l("p"),Y.textContent=pt,Ie=o(),J=l("p"),J.textContent=ct,Se=o(),g(K.$$.fragment),je=o(),X=l("p"),X.textContent=gt,De=o(),Z=l("p"),Z.textContent=vt,Re=o(),g(c.$$.fragment),We=o(),ee=l("p"),ee.textContent=wt,Oe=o(),g(te.$$.fragment),qe=o(),ae=l("p"),this.h()},l(e){const t=At("svelte-u9bgzb",document.head);r=s(t,"META",{name:!0,content:!0}),t.forEach(i),u=n(e),d=s(e,"P",{}),bt(d).forEach(i),h=n(e),v(k.$$.fragment,e),ne=n(e),$=s(e,"P",{"data-svelte-h":!0}),m($)!=="svelte-13fom21"&&($.textContent=Ue),le=n(e),T=s(e,"UL",{"data-svelte-h":!0}),m(T)!=="svelte-1o5w21i"&&(T.innerHTML=Be),se=n(e),C=s(e,"P",{"data-svelte-h":!0}),m(C)!=="svelte-gnkbgl"&&(C.textContent=Qe),me=n(e),v(M.$$.fragment,e),re=n(e),_=s(e,"P",{"data-svelte-h":!0}),m(_)!=="svelte-w1xfw5"&&(_.textContent=Fe),de=n(e),A=s(e,"P",{"data-svelte-h":!0}),m(A)!=="svelte-16923oq"&&(A.textContent=Ne),ue=n(e),L=s(e,"P",{"data-svelte-h":!0}),m(L)!=="svelte-p9vk4k"&&(L.textContent=Ye),he=n(e),P=s(e,"P",{"data-svelte-h":!0}),m(P)!=="svelte-1h3bmko"&&(P.innerHTML=Je),fe=n(e),H=s(e,"P",{"data-svelte-h":!0}),m(H)!=="svelte-1c2eqjh"&&(H.innerHTML=Ke),pe=n(e),V=s(e,"P",{"data-svelte-h":!0}),m(V)!=="svelte-16d6aha"&&(V.textContent=Xe),ce=n(e),E=s(e,"P",{"data-svelte-h":!0}),m(E)!=="svelte-2y62d2"&&(E.textContent=Ze),ge=n(e),I=s(e,"P",{"data-svelte-h":!0}),m(I)!=="svelte-10jkjvr"&&(I.textContent=et),ve=n(e),S=s(e,"P",{"data-svelte-h":!0}),m(S)!=="svelte-1hvaac6"&&(S.innerHTML=tt),we=n(e),j=s(e,"UL",{"data-svelte-h":!0}),m(j)!=="svelte-912db1"&&(j.innerHTML=it),xe=n(e),v(D.$$.fragment,e),ye=n(e),R=s(e,"P",{"data-svelte-h":!0}),m(R)!=="svelte-yev3hc"&&(R.textContent=at),be=n(e),W=s(e,"UL",{"data-svelte-h":!0}),m(W)!=="svelte-1qij1lr"&&(W.innerHTML=ot),ke=n(e),O=s(e,"P",{"data-svelte-h":!0}),m(O)!=="svelte-1y68ykp"&&(O.textContent=nt),$e=n(e),v(q.$$.fragment,e),Te=n(e),z=s(e,"P",{"data-svelte-h":!0}),m(z)!=="svelte-w1q3g9"&&(z.textContent=lt),Ce=n(e),G=s(e,"P",{"data-svelte-h":!0}),m(G)!=="svelte-hfe0q2"&&(G.textContent=st),Me=n(e),U=s(e,"P",{"data-svelte-h":!0}),m(U)!=="svelte-1gv11r6"&&(U.innerHTML=mt),_e=n(e),B=s(e,"OL",{"data-svelte-h":!0}),m(B)!=="svelte-1qe4us9"&&(B.innerHTML=rt),Ae=n(e),Q=s(e,"UL",{"data-svelte-h":!0}),m(Q)!=="svelte-1t47cw1"&&(Q.innerHTML=dt),Le=n(e),f=s(e,"OL",{start:!0,"data-svelte-h":!0}),m(f)!=="svelte-1tslxh8"&&(f.innerHTML=ut),Pe=n(e),F=s(e,"UL",{"data-svelte-h":!0}),m(F)!=="svelte-12pwjv0"&&(F.innerHTML=ht),He=n(e),v(p.$$.fragment,e),Ve=n(e),N=s(e,"P",{"data-svelte-h":!0}),m(N)!=="svelte-s2acs8"&&(N.innerHTML=ft),Ee=n(e),Y=s(e,"P",{"data-svelte-h":!0}),m(Y)!=="svelte-f0l49d"&&(Y.textContent=pt),Ie=n(e),J=s(e,"P",{"data-svelte-h":!0}),m(J)!=="svelte-1m3suzu"&&(J.textContent=ct),Se=n(e),v(K.$$.fragment,e),je=n(e),X=s(e,"P",{"data-svelte-h":!0}),m(X)!=="svelte-imhup8"&&(X.textContent=gt),De=n(e),Z=s(e,"P",{"data-svelte-h":!0}),m(Z)!=="svelte-1ujb0ci"&&(Z.textContent=vt),Re=n(e),v(c.$$.fragment,e),We=n(e),ee=s(e,"P",{"data-svelte-h":!0}),m(ee)!=="svelte-1ezlpbr"&&(ee.textContent=wt),Oe=n(e),v(te.$$.fragment,e),qe=n(e),ae=s(e,"P",{}),bt(ae).forEach(i),this.h()},h(){Ge(r,"name","hf:doc:metadata"),Ge(r,"content",It),Ge(f,"start","2")},m(e,t){Lt(document.head,r),a(e,u,t),a(e,d,t),a(e,h,t),w(k,e,t),a(e,ne,t),a(e,$,t),a(e,le,t),a(e,T,t),a(e,se,t),a(e,C,t),a(e,me,t),w(M,e,t),a(e,re,t),a(e,_,t),a(e,de,t),a(e,A,t),a(e,ue,t),a(e,L,t),a(e,he,t),a(e,P,t),a(e,fe,t),a(e,H,t),a(e,pe,t),a(e,V,t),a(e,ce,t),a(e,E,t),a(e,ge,t),a(e,I,t),a(e,ve,t),a(e,S,t),a(e,we,t),a(e,j,t),a(e,xe,t),w(D,e,t),a(e,ye,t),a(e,R,t),a(e,be,t),a(e,W,t),a(e,ke,t),a(e,O,t),a(e,$e,t),w(q,e,t),a(e,Te,t),a(e,z,t),a(e,Ce,t),a(e,G,t),a(e,Me,t),a(e,U,t),a(e,_e,t),a(e,B,t),a(e,Ae,t),a(e,Q,t),a(e,Le,t),a(e,f,t),a(e,Pe,t),a(e,F,t),a(e,He,t),w(p,e,t),a(e,Ve,t),a(e,N,t),a(e,Ee,t),a(e,Y,t),a(e,Ie,t),a(e,J,t),a(e,Se,t),w(K,e,t),a(e,je,t),a(e,X,t),a(e,De,t),a(e,Z,t),a(e,Re,t),w(c,e,t),a(e,We,t),a(e,ee,t),a(e,Oe,t),w(te,e,t),a(e,qe,t),a(e,ae,t),ze=!0},p(e,[t]){const xt={};t&2&&(xt.$$scope={dirty:t,ctx:e}),p.$set(xt);const yt={};t&2&&(yt.$$scope={dirty:t,ctx:e}),c.$set(yt)},i(e){ze||(x(k.$$.fragment,e),x(M.$$.fragment,e),x(D.$$.fragment,e),x(q.$$.fragment,e),x(p.$$.fragment,e),x(K.$$.fragment,e),x(c.$$.fragment,e),x(te.$$.fragment,e),ze=!0)},o(e){y(k.$$.fragment,e),y(M.$$.fragment,e),y(D.$$.fragment,e),y(q.$$.fragment,e),y(p.$$.fragment,e),y(K.$$.fragment,e),y(c.$$.fragment,e),y(te.$$.fragment,e),ze=!1},d(e){e&&(i(u),i(d),i(h),i(ne),i($),i(le),i(T),i(se),i(C),i(me),i(re),i(_),i(de),i(A),i(ue),i(L),i(he),i(P),i(fe),i(H),i(pe),i(V),i(ce),i(E),i(ge),i(I),i(ve),i(S),i(we),i(j),i(xe),i(ye),i(R),i(be),i(W),i(ke),i(O),i($e),i(Te),i(z),i(Ce),i(G),i(Me),i(U),i(_e),i(B),i(Ae),i(Q),i(Le),i(f),i(Pe),i(F),i(He),i(Ve),i(N),i(Ee),i(Y),i(Ie),i(J),i(Se),i(je),i(X),i(De),i(Z),i(Re),i(We),i(ee),i(Oe),i(qe),i(ae)),i(r),b(k,e),b(M,e),b(D,e),b(q,e),b(p,e),b(K,e),b(c,e),b(te,e)}}}const It='{"title":"A Multimodal World","local":"a-multimodal-world","sections":[{"title":"What is Multimodality? 📸📝🎵","local":"what-is-multimodality-","sections":[],"depth":2},{"title":"Multimodal Datasets","local":"multimodal-datasets","sections":[],"depth":2},{"title":"Multimodal Tasks and Models","local":"multimodal-tasks-and-models","sections":[],"depth":2},{"title":"An application of multimodality: Multimodal Search 🔎📲💻","local":"an-application-of-multimodality-multimodal-search-","sections":[],"depth":2}],"depth":1}';function St(ie){return Ct(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ot extends Mt{constructor(r){super(),_t(this,r,St,Et,Tt,{})}}export{Ot as component};
