import{s as $t,o as Mt,n as Ct}from"../chunks/scheduler.7bc62968.js";import{S as _t,i as Lt,g as l,s as n,r as J,A as At,h as s,f as i,c as o,j as kt,u as K,x as m,k as Ue,y as Pt,a,v as X,d as Z,t as ee,w as te}from"../chunks/index.2f8492b0.js";import{T as Tt}from"../chunks/Tip.016f38d9.js";import{H as ne}from"../chunks/Heading.14fb2476.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:Ct,d(d){d&&i(r)}}}function Vt(ie){let r,u='💡Meta released 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-1vgnoie"&&(r.innerHTML=u)},m(d,h){a(d,r,h)},p:Ct,d(d){d&&i(r)}}}function It(ie){let r,u,d,h,g,oe,v,Fe="Welcome to the chapter on Fusion of Text and Vision. This chapter builds the foundation for the later sections of the unit. We will explore:",le,w,Ge="<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,x,Be="So let’s begin 🤗",me,y,re,b,Qe="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,k,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,T,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,C,Je='<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/multimodal_fusion_text_vision/multimodal_elephant.png" alt="Multimodality Notion"/>',fe,$,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,M,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,_,Ze='<img src="https://huggingface.co/datasets/hf-vision/course-assets/main/resolve/multimodal_fusion_text_vision/bigbang.jpg" alt="Funny Image + Text Meme example"/>',ge,L,et=`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.`,ve,A,tt=`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.`,we,P,it="<strong>Common combinations of modalities and real life examples:</strong>",xe,H,at="<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>",ye,V,be,I,nt="A dataset consisting of multiple modalities is a multimodal dataset. Out of the common modality combinations let us see some examples:",ke,S,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>',Te,E,lt=`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.`,Ce,j,$e,D,st=`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.`,Me,R,mt="Hugging Face supports a wide variety of multimodal tasks. Let us look into some of them.",_e,W,rt="<strong>Some multimodal tasks supported by 🤗 and their variants:</strong>",Le,q,dt="<li>Vision + Text:</li>",Ae,O,ut='<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>',Pe,f,ht="<li>Audio + Text:</li>",He,z,ft='<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>',Ve,p,Ie,U,pt='<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/main/multimodal_fusion_text_vision/Multimodal.jpg" alt="Multimodal model flow"/>',Se,F,ct=`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.`,Ee,G,gt="A detailed section on multimodal tasks and models with a focus on Vision and Text, will be discussed in the next chapter.",je,B,De,Q,vt=`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.`,Re,N,wt="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.",We,c,qe,Y,xt="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,ae,ze;return g=new ne({props:{title:"Introduction",local:"introduction",headingTag:"h1"}}),y=new ne({props:{title:"What is multimodality? 📸📝🎵",local:"what-is-multimodality-",headingTag:"h2"}}),V=new ne({props:{title:"Multimodal Datasets",local:"multimodal-datasets",headingTag:"h2"}}),j=new ne({props:{title:"Multimodal Tasks and Models",local:"multimodal-tasks-and-models",headingTag:"h2"}}),p=new Tt({props:{$$slots:{default:[Ht]},$$scope:{ctx:ie}}}),B=new ne({props:{title:"An application of multimodality: Multimodal Search 🔎📲💻",local:"an-application-of-multimodality-multimodal-search-",headingTag:"h2"}}),c=new Tt({props:{$$slots:{default:[Vt]},$$scope:{ctx:ie}}}),{c(){r=l("meta"),u=n(),d=l("p"),h=n(),J(g.$$.fragment),oe=n(),v=l("p"),v.textContent=Fe,le=n(),w=l("ul"),w.innerHTML=Ge,se=n(),x=l("p"),x.textContent=Be,me=n(),J(y.$$.fragment),re=n(),b=l("p"),b.textContent=Qe,de=n(),k=l("p"),k.textContent=Ne,ue=n(),T=l("p"),T.textContent=Ye,he=n(),C=l("p"),C.innerHTML=Je,fe=n(),$=l("p"),$.innerHTML=Ke,pe=n(),M=l("p"),M.textContent=Xe,ce=n(),_=l("p"),_.innerHTML=Ze,ge=n(),L=l("p"),L.textContent=et,ve=n(),A=l("p"),A.textContent=tt,we=n(),P=l("p"),P.innerHTML=it,xe=n(),H=l("ul"),H.innerHTML=at,ye=n(),J(V.$$.fragment),be=n(),I=l("p"),I.textContent=nt,ke=n(),S=l("ul"),S.innerHTML=ot,Te=n(),E=l("p"),E.textContent=lt,Ce=n(),J(j.$$.fragment),$e=n(),D=l("p"),D.textContent=st,Me=n(),R=l("p"),R.textContent=mt,_e=n(),W=l("p"),W.innerHTML=rt,Le=n(),q=l("ol"),q.innerHTML=dt,Ae=n(),O=l("ul"),O.innerHTML=ut,Pe=n(),f=l("ol"),f.innerHTML=ht,He=n(),z=l("ul"),z.innerHTML=ft,Ve=n(),J(p.$$.fragment),Ie=n(),U=l("p"),U.innerHTML=pt,Se=n(),F=l("p"),F.textContent=ct,Ee=n(),G=l("p"),G.textContent=gt,je=n(),J(B.$$.fragment),De=n(),Q=l("p"),Q.textContent=vt,Re=n(),N=l("p"),N.textContent=wt,We=n(),J(c.$$.fragment),qe=n(),Y=l("p"),Y.textContent=xt,Oe=n(),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=o(e),d=s(e,"P",{}),kt(d).forEach(i),h=o(e),K(g.$$.fragment,e),oe=o(e),v=s(e,"P",{"data-svelte-h":!0}),m(v)!=="svelte-1iyniya"&&(v.textContent=Fe),le=o(e),w=s(e,"UL",{"data-svelte-h":!0}),m(w)!=="svelte-w6qdms"&&(w.innerHTML=Ge),se=o(e),x=s(e,"P",{"data-svelte-h":!0}),m(x)!=="svelte-gnkbgl"&&(x.textContent=Be),me=o(e),K(y.$$.fragment,e),re=o(e),b=s(e,"P",{"data-svelte-h":!0}),m(b)!=="svelte-1u991ft"&&(b.textContent=Qe),de=o(e),k=s(e,"P",{"data-svelte-h":!0}),m(k)!=="svelte-1pjtgza"&&(k.textContent=Ne),ue=o(e),T=s(e,"P",{"data-svelte-h":!0}),m(T)!=="svelte-p9vk4k"&&(T.textContent=Ye),he=o(e),C=s(e,"P",{"data-svelte-h":!0}),m(C)!=="svelte-1h3bmko"&&(C.innerHTML=Je),fe=o(e),$=s(e,"P",{"data-svelte-h":!0}),m($)!=="svelte-1c2eqjh"&&($.innerHTML=Ke),pe=o(e),M=s(e,"P",{"data-svelte-h":!0}),m(M)!=="svelte-16d6aha"&&(M.textContent=Xe),ce=o(e),_=s(e,"P",{"data-svelte-h":!0}),m(_)!=="svelte-1nrybsm"&&(_.innerHTML=Ze),ge=o(e),L=s(e,"P",{"data-svelte-h":!0}),m(L)!=="svelte-2y62d2"&&(L.textContent=et),ve=o(e),A=s(e,"P",{"data-svelte-h":!0}),m(A)!=="svelte-10jkjvr"&&(A.textContent=tt),we=o(e),P=s(e,"P",{"data-svelte-h":!0}),m(P)!=="svelte-1hvaac6"&&(P.innerHTML=it),xe=o(e),H=s(e,"UL",{"data-svelte-h":!0}),m(H)!=="svelte-w92k4b"&&(H.innerHTML=at),ye=o(e),K(V.$$.fragment,e),be=o(e),I=s(e,"P",{"data-svelte-h":!0}),m(I)!=="svelte-yev3hc"&&(I.textContent=nt),ke=o(e),S=s(e,"UL",{"data-svelte-h":!0}),m(S)!=="svelte-1qij1lr"&&(S.innerHTML=ot),Te=o(e),E=s(e,"P",{"data-svelte-h":!0}),m(E)!=="svelte-1y68ykp"&&(E.textContent=lt),Ce=o(e),K(j.$$.fragment,e),$e=o(e),D=s(e,"P",{"data-svelte-h":!0}),m(D)!=="svelte-w1q3g9"&&(D.textContent=st),Me=o(e),R=s(e,"P",{"data-svelte-h":!0}),m(R)!=="svelte-hfe0q2"&&(R.textContent=mt),_e=o(e),W=s(e,"P",{"data-svelte-h":!0}),m(W)!=="svelte-1gv11r6"&&(W.innerHTML=rt),Le=o(e),q=s(e,"OL",{"data-svelte-h":!0}),m(q)!=="svelte-1qe4us9"&&(q.innerHTML=dt),Ae=o(e),O=s(e,"UL",{"data-svelte-h":!0}),m(O)!=="svelte-1t47cw1"&&(O.innerHTML=ut),Pe=o(e),f=s(e,"OL",{start:!0,"data-svelte-h":!0}),m(f)!=="svelte-1k5rt4s"&&(f.innerHTML=ht),He=o(e),z=s(e,"UL",{"data-svelte-h":!0}),m(z)!=="svelte-12pwjv0"&&(z.innerHTML=ft),Ve=o(e),K(p.$$.fragment,e),Ie=o(e),U=s(e,"P",{"data-svelte-h":!0}),m(U)!=="svelte-s2acs8"&&(U.innerHTML=pt),Se=o(e),F=s(e,"P",{"data-svelte-h":!0}),m(F)!=="svelte-1xx3ryf"&&(F.textContent=ct),Ee=o(e),G=s(e,"P",{"data-svelte-h":!0}),m(G)!=="svelte-1m3suzu"&&(G.textContent=gt),je=o(e),K(B.$$.fragment,e),De=o(e),Q=s(e,"P",{"data-svelte-h":!0}),m(Q)!=="svelte-msjj5c"&&(Q.textContent=vt),Re=o(e),N=s(e,"P",{"data-svelte-h":!0}),m(N)!=="svelte-1ujb0ci"&&(N.textContent=wt),We=o(e),K(c.$$.fragment,e),qe=o(e),Y=s(e,"P",{"data-svelte-h":!0}),m(Y)!=="svelte-1ezlpbr"&&(Y.textContent=xt),Oe=o(e),ae=s(e,"P",{}),kt(ae).forEach(i),this.h()},h(){Ue(r,"name","hf:doc:metadata"),Ue(r,"content",St),Ue(f,"start","2")},m(e,t){Pt(document.head,r),a(e,u,t),a(e,d,t),a(e,h,t),X(g,e,t),a(e,oe,t),a(e,v,t),a(e,le,t),a(e,w,t),a(e,se,t),a(e,x,t),a(e,me,t),X(y,e,t),a(e,re,t),a(e,b,t),a(e,de,t),a(e,k,t),a(e,ue,t),a(e,T,t),a(e,he,t),a(e,C,t),a(e,fe,t),a(e,$,t),a(e,pe,t),a(e,M,t),a(e,ce,t),a(e,_,t),a(e,ge,t),a(e,L,t),a(e,ve,t),a(e,A,t),a(e,we,t),a(e,P,t),a(e,xe,t),a(e,H,t),a(e,ye,t),X(V,e,t),a(e,be,t),a(e,I,t),a(e,ke,t),a(e,S,t),a(e,Te,t),a(e,E,t),a(e,Ce,t),X(j,e,t),a(e,$e,t),a(e,D,t),a(e,Me,t),a(e,R,t),a(e,_e,t),a(e,W,t),a(e,Le,t),a(e,q,t),a(e,Ae,t),a(e,O,t),a(e,Pe,t),a(e,f,t),a(e,He,t),a(e,z,t),a(e,Ve,t),X(p,e,t),a(e,Ie,t),a(e,U,t),a(e,Se,t),a(e,F,t),a(e,Ee,t),a(e,G,t),a(e,je,t),X(B,e,t),a(e,De,t),a(e,Q,t),a(e,Re,t),a(e,N,t),a(e,We,t),X(c,e,t),a(e,qe,t),a(e,Y,t),a(e,Oe,t),a(e,ae,t),ze=!0},p(e,[t]){const yt={};t&2&&(yt.$$scope={dirty:t,ctx:e}),p.$set(yt);const bt={};t&2&&(bt.$$scope={dirty:t,ctx:e}),c.$set(bt)},i(e){ze||(Z(g.$$.fragment,e),Z(y.$$.fragment,e),Z(V.$$.fragment,e),Z(j.$$.fragment,e),Z(p.$$.fragment,e),Z(B.$$.fragment,e),Z(c.$$.fragment,e),ze=!0)},o(e){ee(g.$$.fragment,e),ee(y.$$.fragment,e),ee(V.$$.fragment,e),ee(j.$$.fragment,e),ee(p.$$.fragment,e),ee(B.$$.fragment,e),ee(c.$$.fragment,e),ze=!1},d(e){e&&(i(u),i(d),i(h),i(oe),i(v),i(le),i(w),i(se),i(x),i(me),i(re),i(b),i(de),i(k),i(ue),i(T),i(he),i(C),i(fe),i($),i(pe),i(M),i(ce),i(_),i(ge),i(L),i(ve),i(A),i(we),i(P),i(xe),i(H),i(ye),i(be),i(I),i(ke),i(S),i(Te),i(E),i(Ce),i($e),i(D),i(Me),i(R),i(_e),i(W),i(Le),i(q),i(Ae),i(O),i(Pe),i(f),i(He),i(z),i(Ve),i(Ie),i(U),i(Se),i(F),i(Ee),i(G),i(je),i(De),i(Q),i(Re),i(N),i(We),i(qe),i(Y),i(Oe),i(ae)),i(r),te(g,e),te(y,e),te(V,e),te(j,e),te(p,e),te(B,e),te(c,e)}}}const St='{"title":"Introduction","local":"introduction","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 Et(ie){return Mt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class qt extends _t{constructor(r){super(),Lt(this,r,Et,It,$t,{})}}export{qt as component};
