 Welcome back, everyone. Hope you all are enjoying the EuroPython conference. I'm Mohsar Seva. I'll be your host for the two upcoming sessions. There is an announcement for you all. Sprints are starting tomorrow. This is your chance to find more developers and collaborators for your open source projects and also to educate people about them. So please consider listing your project and registering for the Sprints on the registration page, the link to which has already been shared on the metrics channel. It's time to welcome our next speaker now, Utkarsh Mishra. Utkarsh is a final year computer science and engineering undergrad, and he has been working in the field of machine learning and deep learning domain for the two years now. He's currently working as a machine learning developer at Koal Infotech. How are you, Utkarsh? Hello, Anum. From where are you joining? I'm doing in Andabad, India. So today, Utkarsh will be talking about using Python and Flutter for coloring and enhancing old photos. Sounds interesting. So over to you now, Utkarsh. Good luck for your talk. OK. So hello, everyone. I'm Utkarsh, and I will be here to present my talk on Python and Flutter, Application for Coloring and Enhancing Old Photos. So first of all, as Anum told you about me, and I'll just be giving a small introduction about me also. So I'm a machine learning developer, as well as a finally undergrad student. And I work as a company and an ML developer at Koal Infotech. It's an RPA-based service company. And my major technical skills are in deep learning, machine learning, and a little bit about in Flutter, after document and data science, data analytics. So first of all, what are photos? The most important question. So for me, photos are, this is some kind of a computer science language. You can see it is an image. So an image that represents some external form of person from a past. So it basically communicates any past incidents or activities to us, reminding us of those memories. They can be melodious also. They can be unhappy also. So that goes on. So next is, what are black and white images? So black and white images of black and white photography can be considered much more subtle and less realistic than colored photography. And most of those black and white photos or we can even call them monochromatic photos are some what interpretations of the subjects. And they also are a little bit about an extract from the reality, like an extract from a reality that is represented in colors or the shades of gray. That ranges from 0 and to 1 to 55. That's mostly about computer science. And this sometimes also feels somewhat empty. So that's why we think about coloring images because they look great. And these colors also gusses emotions, different, different. So there are many techniques, a few of the major use techniques for coloring these black and white or the monochromatic photos by hand that has been done for thousands of years. And the second one is through Adobe Photoshop that has been correctly used and has been vastly used nowadays. And that takes a technology to our technology or I can say a system to implement. But then the most important question that raises here is why do we need machine learning for this thing? These most of these techniques requires a lot of time and are very labor intensive also. So to reduce time, we use machine learning because using machine learning through models and those stuffs, our photos can be colored in a matter of seconds or max to max to a minute. It won't take longer than a minute if we have a single image. So first of all, basically my application that I have to build is a Flutter application. The front end is in Flutter and the back end, all the processing, conversion, image conversion is being done through an API which is built in Python Flask. So this is the flowchart of the API and we will be discussing each of these segments later. Okay, so first of all is about basic introduction related to machine learning, deep learning and the model architecture. So the first question that rises in our mind is what is deep learning? And what can be the difference between a deep learning architecture or a machine learning model or an AI also? So basically an AI, what is the work of an AI? So AI tries to mimic human activities or human decision making, right? And machines are a machine learning is a subset of AI and it basically contains all those algorithms and techniques to train a machine on a data and then do those decision making things. Whereas deep learning is also a subset of machine, even machine learning that makes us a subset of AI and it tries to solve more complex problems which are generally related to, they can be related to text, more generally related to images, sounds or some unstructured kind of data like language processing and other stuff. So the first thing that comes is deep learning. So there should be types. So we will be discussing about three or four months like the fee for a neural network, RCNN, CNN, or recognition neural network, convolution neural network and about it or encoder. So the first one is a fee for a neural network. So basically in a fee for a neural network there are some very basic kind of neural networks and we have an information flow from an input layer to the output layer and mostly they contain just a single hidden layer along with this input and output layers. So most of the time they also don't require back propagation and they are mostly using these facial recognition algorithms that we can use in computer version and in this process and stuff. So next is a recurrent neural network. It's kind of a tricky one. So in the recurrent neural network the output from the previous neuron or we can call it as a node also is being passed as an input to the next or to the next node or the next neuron. These network architectures are very helpful as they take very less amount of memory. So they are very helpful in building softwares that require machine learning as well as very low memory like chatbots. So these technologies can be used in building chatbots, text applications, language processing, speech and audio processing, those stuffs. Next and the thing that I have used is a convolution neural network. It's also called as connet or CNN and they are mostly used to analyze imagery data. Mostly images, image related data. We can also use audio and speech data also but mostly they are used for images. They try to extract features from the image or the audio signal data by performing some sequences of convolution pulling operations. We know so basically the CNN contains two important things, convolution operation and a pulling operation, you know that. So before going to convolution pulling operation I will just be telling you about kernels. So in these kernels are also sometimes called as convolution matrices or filters are like small matrices, two dimensional matrices and they are used for blurring sharpening an image or an S detection to get the images from an image. So basically we try to accomplish so basically we accomplish this by doing some convolution operation between the kernel and the original image. Like as the example has been given there is some kind of an animal. Most probably a mouse, I think so it's a deer. So an S detection kernel has been applied and it shows the edges in the image. So the next is the convolution operation that we get a lot. So basically these convolution operations are the main thing that are used to extract some of these feature maps. They do what they like, they multiply individual elements of individual elements in each cell or in each pixel by the kernel and then sums them up to get an output feature. You can see they're using the zip file. Zip file. Next I will use tensor to start just beginning an example also. So in the con 2D, in the con 2D we can use a using tensor flow. We can do this by using Keras that's a tensor load of Keras dot con 2D layer. And we have you, in the example I've used 32 filters. So they're like 32 different kinds of kernels and each of them have a size three comma three means have dimensions they are of two dimension and have size three cross three. And it has given the padding a same that means the input image and the output image after the convolution also we can get the same images. I have also applied ReLU activation function and a little bit of a regularizer. So next is a pooling operation. So pooling operations can classify into two types like max pooling and average pooling. But before that pooling can be called as some kind of down sampling of feature. We can just say that the down samples are feature images to get a summarized or a compact form of our feature maps. Like the images or the data is being in feature maps when you pass a pooling layer, when you pass it through a pooling layer it reduces its size and compacts our data also reduces the number of computational variables that also increases our, that's also decreases our time complexity over the pooling. So the pooling layer also uses the TensorFlow.keras from the TensorFlow.keras and for the max pooling we can use keras.layers.max pooling 2D. We are just dealing with a 2D image. 2D image vectors are only here. 2D tensors and for the average pooling we can use keras.layers.keras, average pooling 2D. We are using a pool size of two means like the small vector size in the last image. That's the size of that kernel. We can also call this kernel or filter kind of thing. So that in this case we call it as a pool size. So we can also have a stride, stride of three or two by two. That means the cell would be shifting to twice. In most of the operations in most of the layers pooling by applying two by two pool size and two by two stride we can reduce the number of parameters to half as well as we can only get the important structures, add layer. So basically we have this add layer. In add layer it's like assume that we have two matrices and we perform two additional between the two matrices. They're individual elements which have the same locations have been added up. So this layer also performs the same operation. The next is an autoencoder. So basically autoencoder is a type of artificial network. We can also call it artificial ANN. And it tries to learn the data from me. It tries to learn from the compact representation of the data. Just like an autoencoder has basically three parts and encoder section, a decoder section and a latent space which we can also call this bottleneck section. And it's sometimes it's been categorized sometimes it's been included in the part of the autoencoder only, sorry, encoder only. So these autoencoder does what the autoencoder compresses the input data. We add the decoder tries to recreate the input image by adding some kind of features and up sampling it and doing this from the compressed version of that data that has been given to the, that has been provided by the encoder and it has been saved in the latent space for the bottleneck layer portion. So this example is how we can apply an autoencoder. We just have a, we have an image of 784.1 and we have just down sampled the image. Then we are just the bottleneck layer has a number of it is 32. And from 32, we are just up sampling the images to 784 again. So they're like different types of autoencoder but we do focusing on the one called as convolutional autoencoder. So before going to convolutional autoencoder, there's something called a skip connection. And I will be telling you about that. Why do we use basically the skip connection? So there is some kind of thing called as degradation problem. So in the degradation problem, when we have a model with a high depth or more number of layers, then each passing layer, the value of those grad gradients or the values become smaller and smaller. This reduces the performance and accuracy of the model on both training and testing data. So that's why we try to use skip connections so that our data and the feature maps are not being completed, are not completely lost and the data can be received. Can be extracted to this full list. And that's why we will be using the skip connection. We have used the skip connection in the model like because the skip connection has been applied to the model from the encoder section to the decoder section up for it's been across the model section only. So I would just be showing you about the architecture. So we can just send the data directly, send the data or we can say feature maps because it's an encoder part only. So it's the matrix of the tensor. So I would be sending the data or the feature map from the bottleneck section to the decoder part and it will help the decoder and more clearly it will help it to identify the decompressed image. It will help in identifying the decompression of the image from the input image that has been provided to the decoder. So next is our API flowchart again and I would be telling you about the model architecture that I have used in the colorization of the model. So basically I didn't get the same image. So I just, I referenced it. So my model looks kind of similar to the unit architecture but it has some different variables and parameters and some different amount of layers. So this is a small of my encoding drop. So I used, I considered it to be used three concrete layers to extract this feature. Then I have down sampled it. So to compress those features and reduce the dimensionality also and the number of parameters. So in the decoder section, I have used the up sampling feature. The first of all, the data has been sampled. Then a bottleneck or the skip connection from the encoder section has been passed, it's been added to the first layer of the up sampled image. It's been added and then that added image is being convoluted trial, it's been convoluted thrice to get an output image. That output also an output feature map and that output feature map is then again be up sampled and then the same process goes on just like the unit architecture. So apart from the unit architecture, I have used other functionalities also like coloring an API and these things like gamma correction and super image. So I've used a gamma correction somewhere. So basically what is gamma correction? So gamma correction tries to control the overall brightness of that image. So by varying the amount of gamma, like the gamma is some kind of value. So by varying the amount of this gamma value, we can change the brightness of the image and as well as it also sometimes changes the ratio of the three color channels in the image. That is the red, green and blue. So this is how I've added gamma correction and just put it in here. So in the next, I have given a condition that sometimes the original image is very small. So I don't want the image to be smaller than like 500 pixels. So I just gave it a condition that if the number of pixels have been smaller to 500 pixel, it would be passed to another model called as for the super image resolution that will increase its resolution of that image and return the image. If the image is higher than 500 pixel, then it would actually return the image. If it is not, it will go to super image resolution. So what is the super image resolution thing? So basically the super image resolution are the kinds of algorithms or the techniques that tries to enhance or increase the resolution of the image. For example, if I like take an image, if I increase its width and height, then the image, the quality of the image should not be compromised or has been compromised in the least. That's what's called as super image resolution. Next is our API, introduction to the API using Flask and Flutter. So basically the first thing is when API, most of the people have learned about API. So what is an API? So the API is kind of a software intermediary. It's an intermediate between two of the softwares that and it tries to communicate between those, it tries to access a gateway for communication between both the two systems. Or we can sometimes also call it a system and service. Like if you take an example, we have used Facebook, we have used some kind of texting softwares, like chatting softwares like WhatsApp or Messenger. So if we want current weather, so we have seen weather. So all those things uses a backend API. They're like different frameworks for the API in Python. And I've used some of Flask. So I'm just gonna tell you about Flask a little bit. So basically the Flask is like, there's the second line, I haven't put it in the Flask. In the second line, I will give you a little app equals to Flask in brackets, underscore, underscore name, underscore, underscore. It generally means that I'm just building a Flask structure and in the main section, I have applied app.run means our app would be running. And in the app.require.route slash hello means if whenever you get a server link or the URL, if I apply slash hello there, it will return us a JSON object or we can say a JSON object and it will show success hello. So I'll just use an example here. So next is about Flutter. So first of all, the Flutter, it has expressed a beautiful UI. So basically what does this mean? So Flutter has many built in material designs and we have something called a Sculptor visits. We can see those Sculptor visits in iOS apps or I can say in iPhones or iMacs. So that design, it differs from the Android design. So that's called a Sculptor. We can call those Sculptor visits as well. The visits can be called as Sculptor-nude visits. It has different types of Sculptor-nude visits and it has some different types of smooth, like natural scrolling features, API features, button features and it also has platform awareness. Like on which platform it's working on or it's running on. So the next is the native production and native performance. So the most important thing in the Flutter is for what I also like it is like, I can develop my app when it's running also and I just can click save button and it's re-loads. So I will just be telling you about that in the next slide. So basically what does what it has, it can be the application can be developed while running it and it can incorporate all the important features of that platforms like in the Dart, it is native. So I can just run a single code on different different platforms. So then also in different platforms, it can differentiate between those platforms and it can incorporate different features that are suitable to that level of that platform. Like in the scrolling in the mobiles, we have a single finger type scroll in the web we have a mouse scroll or a button scroll. So we have scrolling, we have navigation, we have icons, we have fonts and many more. So next is the app like fast development. So in the Flutter, we have two things called as hot reload and hot restart. And then like on the click of a save button, my apps is reloads and it just reloads the feature that I like it just reloads the feature that I've just implemented and will be shown on my device. So this helps in quickly experimenting with the UI and features and other and can help in fixing the bugs also. And the last thing is it's completely open source. So just like Python, it's freely available and has many packages and those packages are called in Python, they're called packages in Dart, they are in Flutter, they are called as plugins. So the official language for Flutter is Dart. It's kind of similar to Java only. There is like platform availability. So it is, I said it's needed. So a single Dart code can be run on and more than mobile devices like Android, iOS. For the web also, for the desktop and desktop, we have Linux, we have iOS, macOS, we have Windows. So it can run on all those. It even started working on embedded devices like iOS and like, sorry, no. And embedded devices like Raspberry Pi and Arduino. The next, it's like a sample code here. So this is a code, whenever the main function is executed, like when we run it, the main function is being accessed as a function. So it runs the app that run, that app contains, like in Flutter, we have two types of states, like the stateless and the stateful. So there are two of the main differences. So the main, my app is a stateless app and it runs a material app. The material app is the complete app. The complete app would be enclosed in a material app. So material app, and it just go on. And in the material app, I just passed the class. The class contains a scaffold. The scaffold is the complete page that you guys can see and it's an output. And we have an app bar, the app bar is on the top and the app bar contains something, text written here, called as welcome to Flutter, a very basic one. And in the middle of the screen, we have a written text called as hello world. You guys can see the code. And finally, my slides are over and the final thing is my application demo. If you guys are interested. So this is the application I built and this is the demo. As you guys can see, the image has been colored and we have the last screen, we have two features for sharing that image so we can talk about it. So thank you. All right, so it was a nice talk. I think the fundamentals of computer vision and the demo was really a nice one, of course. So we can have a couple of questions. So people, if you have any questions, please post them into the chat room. As of now, no one has posted. So I believe if anybody has any questions, they can ask you the questions in the breakout paratroop. Thanks a lot again for joining and delivering the talk. It was a really nice one. Thank you. Have a good day. And thank you for giving me the opportunity to present you. Thanks.