Securing REST API using Keycloak and Spring Oauth2

Keycloak is Open Source Identity and Access Management Server, which is a OAuth2 and OpenID Connect(OIDC) protocol complaint. This article is to explain how Spring Boot REST APIs can be secured with…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Do you identify as Latinx and are working in artificial intelligence or know someone who is Latinx and is working in artificial intelligence?

In this entry, we will try to get better results than what we got on the first model.

First of all, we are going to use google colab. So please follow the next link to create one.

Now we can start importing all the necessary packages that we will use.

Important please make sure that you first install the timm library so that you can avoid future problems when running fastai packages.

We are going to loop for each search item and download all the necessary images.

example of how the images are going to be saved

Once we got all the images we are going to check for corrupted ones and delete them so that our model does not crush.

Now we have the images we need to create our DataBlock

The inputs are going to be images “ImageBlock” and the outputs are going to be categories “CategoryBlock”

We can specify a splitter, this will retrieve some of the data to use for validation purposes. In this case, we are using 20% of the data for validation.

We have got our dataloaders. Now we need to look for a “pre-trained” model to use in our learner. I really like using “convnext” they are really reliable and quite light.

Choosing a lr between the valley and the slide is a really good ley of thumb.

Finally, we can create again the learner by choosing the above learning rate

Older model results:

old model training

We can print the top losses, to see some examples:

As you can see with a few modifications to the older model we can create a more powerful one.

Hope you enjoy this simple yet powerful model. I will appreciate it if you give it a clap. Have a nice day! Please feel free to leave a comment if you didn’t understand something I will gladly help you out :).

Added a working URL where you can test the model. Give it a try!

LatinX in AI (LXAI) logo

Add a comment

Related posts:

Nobody Wants to Lead

There is an argument that states “if you want to be a leader, you probably shouldn’t be”. Leadership is something earned from followers, and great leaders often take on the role with a heavy heart…

Budgeting

Many of you may have already answered this question for yourselves. Maybe you have realized you are spending too much going out on the weekend. You may be saving up for studying abroad next semester…

Feature Flags

Projector is a modern, web based design platform targeted at folks that value great design, but may not have the skills, time or the budget to invest in traditional high end native desktop design…