You are on page 1of 51

Backend

Internship
How to be innovative at home
01.
Database
Design
Objectives

Design Process Structure Design Database


Design Process

Reading

Determine
Process Design

Reading What? User Requirement


Read one by one dengan seriously

Identification of Entities & Attribute

Relation

Database Normalization

Identify the Primary Key

Table Design

Implementation
History User Stories

Requirement
Process Design

UR Ijin 3 Jam id INT


Process Design

UR Ijin 3 Jam id INT

karyawan_id INT
Process Design

UR Ijin 3 Jam id INT

karyawan_id INT

status STR
Process Design

UR Ijin 3 Jam id INT

karyawan_id INT

status STR

dapat_dilihat Bool
Process Design

UR Ijin 3 Jam id INT

karyawan_id INT

status STR

dapat_dilihat Bool

judul STR
Process Design

UR Ijin 3 Jam id INT

karyawan_id INT

status STR

dapat_dilihat Bool

judul STR

tanggal Date
Process Design

UR Ijin 3 Jam id INT

karyawan_id INT

status STR

dapat_dilihat Bool

judul STR

tanggal Date

waktu_awal Date
Process Design

UR Ijin 3 Jam id INT

karyawan_id INT

status STR

dapat_dilihat Bool

judul STR

tanggal Date

waktu_awal Date

waktu_akhir Date
Process Design

id INT

karyawan_id INT

status STR

dapat_dilihat Bool

judul STR

tanggal Date

waktu_awal Date

waktu_akhir Date
Process Design

id INT

karyawan_id INT

status STR

dapat_dilihat Bool

judul STR

tanggal Date

waktu_awal Date

waktu_akhir Date
Implementasi
Testing
02. SQLAlchemy
Core
Basic of using SQLAlchemy
Definition

SQLAlchemy is a library that allows developers to interact with databases using


Python.

To install sql alchemy using pip install SQLAlchemy


For documentation: https://docs.sqlalchemy.org/en/20/core/
Feature of SQLAlchemy

Query
You can save query into a variable
so you can use it multiple times

Connecting databases Execute query


Connect with multiple database There are some method for
such as sqlite, postgresql and more executing query such as fetchone,
execute
Connecting to
database
to connect to database need a engine to connect to the
database
To create the the engine import from sqlalchemy
create_engine or create_async_engine
Inside the engine make the link to database using this
dialect+driver://username:password@host:port/database
Table

For the table need meta data to save all the table
After declaring the meta data make the table and create it
For the table that have parent table you can fill none for the
type and use foreign key so it will be same with the parent
reference type
Example
Query

Query can be used to SELECT, INSERT, UPDATE, and


DELETE on the table
Query can be a variable so it can be called again and add
more query so it become complex or you can make a
subquery to add inside the query
For the join, you can use .join to join but you must have the
table inside the same meta data
Example insert
Example select
Example update
Example delete
Advantages and
disadvantages
The advantages:
• You can use one query for multiple use case scenario
• Code is simpler and easier to read
• Integrated with python
Disadvantages:
• If an error happened, it doesn’t specify its error
• There are some cases that the query become too long
because it need a lot parameter
• There are some documentation that incomplete
03.
Image Detection
Model
Phone Number Detection using YOLOv8
Problem

In the advertising images used by


truckers on the Golektruk website. if
there are images containing personal
contacts (personal numbers) it will be
detrimental to the company.
Problem

Previously, images containing personal


contacts will be filtered by the admin.
This method is not so effective because
it wastes a lot of admin time
YOLOv8

YOLOv8 is the newest state-of-the-art YOLO


model that can be used for object detection,
image classification, and instance
segmentation tasks.
Basis Of YOLOv8

Implementation of YOLO
Something you haven’t seen or
tried before could inspire you!

What is YOLOv8 Testing our Model


Keep your body fit so it works This is where your ideas originate,
well in conjunction with your so let’s activate it!
mind!
YOLOv
8
YOLOv8 is the newest state-of-the-art YOLO model that can be
used for object detection, image classification, and instance
segmentation tasks. YOLOv8 was developed by Ultralytics, who
also created the influential and industry-defining YOLOv5 model.
YOLOv8 includes numerous architectural and developer experience
changes and improvements over YOLOv5.
Why we use YOLOv8?

● Based on our testing YOLOv8 performed better than other models such as
Resnet and previous iteration of YOLO
● YOLOv8 able to detect subtle phone number on the picture
● YOLOv8 comes with a lot of developer-convenience features, from an
easy-to-use CLI to a well-structured Python package.

YOLOv8 has a lot of features compared to its predecessors and the ease of use
makes it a good choice
Implementation

● Collecting Image for Dataset


● Labeling Image by using Bounding Box
● Augmentation annd Pre-processing
● Training and testing

We use Roboflow for our workflow creating model


Collecting Dataset
• We collect image manually from the web mainly from
Facebook and google
• Our Search keyword is “Jasa Angkut Truk”, “Ekspedisi
Truk”, “Jasa Muatan Angkut”
• We collect a total of 318 image for our dataset
Labelling our Dataset

• We only use one class for our


labeling that is “phone-
number”
• There can be multiple phone
number in one image that
needed to be labelled
Labelling our Dataset

• After labelling our images we


split our image for train, test,
and split
Preprocessing & Augmentation
• For the augmentation we used
grayscale applying into 15% of
the images, blur up to 0.75px
and noise 5% of the data
• Because of the augmentation
the training set becomes 669
images
• For the preprocessing resized
all picture to 360 x 360 and
auto adjust contrast provided
by Roboflow
Training and testing

• Using YOLOv8 Notebook provided


by roboflow we train our dataset with
100 epoch, training completed in
about 30 minutes
• Link to google colab
https://colab.research.google.com/gith
ub/roboflow-ai/notebooks/blob/main/n
otebooks/train-yolov8-object-detectio
n-on-custom-dataset.ipynb
Training and testing
• Using YOLOv8 Notebook provided
by roboflow we train our dataset with
100 epoch
• Link to google colab
https://colab.research.google.com/gith
ub/roboflow-ai/notebooks/blob/main/n
otebooks/train-yolov8-object-detectio
n-on-custom-dataset.ipynb
Try The Model
https://bit.ly/TestModelyolo

You might also like