teleren/devto huggingface dataset:
Diario de Python | #10. Color Choice: Los colores
Tags: spanish, devjournal, python
Published: 2023-04-11 15:44:02

Los modelos están armados, por lo cual trabajar ahora con el admin iba a ser mucho más sencillo. El primer paso era crear una serie de colores y luego simular unos votos.

Armé el Verde, Rojo y Azul:

![Django Admin colores](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2fyxjmz36xn4zwafv4qd.png)

Luego definí los votos, siendo cada uno único por usuario:

![Django Admin votos](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e1xtx1pc7w9bn1xac84j.png)

Acto seguido, me di cuenta de que algo se me pasó por alto: el modelo de color no tiene ningun valor hexadecimal. Por lo tanto, si armo un color "Negro", sin definir "#000" no hay forma de colorearlo en pantalla. 😲

## Migración de Color
En principio definí el campo con un default en blanco (#FFF), porque sino los registros creados previamente no iban a tener un valor asignado. Otra opción era definir el campo como null, pero eso no tendría sentido dado que cada color debía tener obligatoriamente un nombre y un valor hexadecimal:

```python
hexa = models.CharField(max_length=7, default="#FFF")
```

Por otro lado, en _admin.py_ definí una clase para armar las columnas que quería visualizar tomando los campos de name y hexa.

```python
class ColorAdmin(admin.ModelAdmin):
    list_display = ('name', 'hexa')


admin.site.register(Vote)
admin.site.register(Color, ColorAdmin)
```

Dando como resultado:

![Django Admin registros](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4rm2hb69g58zbyw8p65q.png)

## Definir los valores hexa
Podría abrir Photoshop, Paint o algún editor online de colores, elegir uno y copiarme el valor hexadecimal. Pero me daba pereza, así que decidí hacer algo que me llevaría más trabajo: implementar una librería de colores.

Así descubrí a [django-colorfield](https://pypi.org/project/django-colorfield/). Luego de instalarla con _pip_, modifiqué mi modelo:

```python
from colorfield.fields import ColorField

(...)

hexa = ColorField(max_length=7, default="#FFF")
```

Ahora, por ejemplo si quiero crear un color nuevo, tengo esta belleza en django-admin:

![Django Admin selector de color](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mlwlqb2s4t38nv75p4z2.png)

Ahora puedo definir todos los colores que quiero sin salirme del administrador.

## En el próximo episodio...
Con los colores definidos, ya podemos votar uno. El problema es que la API nos deja emitir votos a cualquier usuario, y eso es una brecha de seguridad enorme.

En el próximo episodio de esta apasionante historia, veremos cómo me meto en las entrañas del módulo de autenticación y tokens para generar sesiones con DRF.
The right ways to accept optional parameters in JavaScript.
Tags: beginners, webdev, javascript, productivity
Published: 2023-04-11 15:42:29

If you’ve worked in any coding scripting language, changes are you’ve created a function that takes values from users. But sometimes these values should be optional, for example a parameter that specifies settings for the function.

## Single Value Parameters.
Let’s say you have a function that takes two numbers, adds them together and returns the result. The code would look something like this.

```javascript
function addTwoNumbers(a, b){
  return a + b
}
```
We know that calling the function like `addTwoNumbers(1, 2);` would result in “3" being returned. But what if we call the function without any parameters like so: `addTwoNumbers();` ? Well I’ll tell you, you’ll get “NaN” or “Not a Number”. Let’s say our application requires a numerical value be returned, we can mitigate this error by setting defaults to the parameters. If we alter the function above to look like this:

```javascript
function addTwoNumbers(a = 0, b = 0){
  return a + b
}
```

Then if we call the function without arguments, now the function returns “0” instead of “NaN”. So to put it simply, to set a parameter’s default value, simply add “= val” in the function definition where you accept the parameters.

## Objects or Arrays.
For some applications, setting a default value for the whole parameter’s value will work. But let’s say we have function that applies a bunch of styles to an element from a parameter named “elemStyles” which is an object like so:

```javascript
function elementStyles(elem, elemStyles= {color: "red", backgroundColor: "black"}){
  for(property in settings){
    elem.style[property] = elemStyles[property];
  }
}
```

If we set up the function like that and then pass `{color: “green”} `as the “elemStyles” parameter, then the “backgroundColor” default setting will be removed since the whole "elemStyles" object would be replaced by the passed value.

We can fix this by altering the function to look like this:

```javascript
function elementStyles(elem, elemStyles){

  const currentStyles ={
    color: "red",
    backgroundColor: "black",
    ...elemStyles
  }

  for(property in currentStyles){
    elem.style[property] = currentStyles[property];
  }
}
```

Now the default settings for the object are defined in “currentStyles” and any properties set by the user will simply overwrite the default properties.

Let me know some methods you use for these functions. Happy Coding everyone!

Thanks for reading! For more tips, tricks and tutorials follow me on [YouTube](https://www.youtube.com/channel/UCKuVsmlR9mRSAatMjgqhsSQ) or [Instagram](https://www.instagram.com/growincode).

Make sure and leave a comment if you want to see me cover something specific.
What's the worst part of finding a programming job?
Published: 2023-04-11 15:25:08

Hello!

I am trying to improve the developer interview process. 

There are many tests, interviews, opacity with the salary and a long etcetera that needs to improve.

Could you share your experience? 

Google Form here as well: https://forms.gle/XBCuMha4fusECyaGA

Thank you so much!
การสร้างโมเดล Linear Regression สำหรับการพยากรณ์ข้อมูลที่มีอยู่ด้วยภาษา Python
Published: 2023-04-11 15:24:40

โมเดล Linear Regression คือ Machine Learning อย่างหนึ่งที่สามารถพยากรณ์สิ่งต่าง ๆ จากข้อมูลที่มีอยู่ สามารถนำมาปรับใช้ได้หลากหลาย ไม่ว่าจะเป็นการทำนายยอดขายของสินค้าในอนาคตหรือราคาอะไรก็ตามที่เรามีข้อมูลราคาในอดีต

บทความนี้จะมานำเสนอโมเดล Linear Regression ด้วยภาษา Python โดยใช้ Google Colab ในการรันโค้ด

## **ขั้นตอนที่ 1**
 **import library ทั้ง LinearRegression และ numpy**

- **LinearRegression** โมเดล Machine Learning ที่ใช้พยากรณ์ผลต่าง ๆ
- **NumPy** เครื่องมือคำนวณที่ทำงานกับอาร์เรย์และเมทริกซ์

`from sklearn.linear_model import LinearRegression
import numpy as np`
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hkjjqpt1zzotalgqisa9.png)

##**ขั้นตอนที่ 2** 
**กำหนดหรือสร้างข้อมูลไว้ในตัวแปร**
กำหนดให้ x_train และ y_train ที่มีขนาด 3x1 และ 1x3 ตามลำดับ
`x_train = np.array([[1], [3], [5]])
y_train = np.array([5, 10, 15])`
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wgtygnxyasxnhucbiftd.png)

##**ขั้นตอนที่ 3** 
**สร้างโมเดลสำหรับ Linear Regression**
`model = LinearRegression()`
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ribe1xal5ol0k9bx5pt.png)

##**ขั้นตอนที่ 4** 
**ฝึกโมเดลด้วยค่าข้อมูลที่เราเคยตั้งหรือกำหนดไว้**
     ทำการฝึกโดยใช้คำสั่ง .fit() 
`model.fit(x_train, y_train) 
`
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/glee79f6dy1lw3wm4ixz.png)

## **ขั้นตอนที่ 5** 
**ใส่ข้อมูลใหม่เข้าไปในตัวแปร**
     
1. สร้างตัวแปรใหม่ที่มีชื่อว่า x_test และใส่ค่าให้มีค่ามากกว่าค่าก่อนหน้า +2 ไปเรื่อย ๆ ตามรูปแบบ x_train (กำหนด x_test ให้มีค่าสอดคล้องกับค่า x_train ของคุณ ตัวอย่างเช่น หาก x_train ของคุณมีรูปแบบที่เพิ่มขึ้นทีละ 1 ค่าของ x_test ก็เช่นกัน)
`x_test = np.array([[7], [9], [11], [13], [15]])`

2. สร้างตัวแปร y_predict มาเก็บค่าที่ได้จากการใช้คำสั่ง .predict 
`y_predict = model.predict(x_test)`

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/txgcsvc4ai8ks5b693ck.png)

##**ขั้นตอนที่ 6** 
**แสดงค่า y_predict**
`print("y predict is", y_predict)`
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lekxmquewpinzq9e109q.png)
ผลที่ได้

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jb66z2xx4txp98hr6min.png)
จะเห็นได้ว่าค่าจากการพยากรณ์มีความสอดคล้องกับค่าที่กำหนดตอนแรกของ y_train

## **สรุปผล**
จากบทความนี้จะเห็นได้ว่าการสร้างโมเดล Linear Regression โดยนำ x_train และ y_train มาสร้างเป็นโมเดลเพื่อนำไปฝึกนั้นสามารถทำนายค่า y จาก x ด้วยคำสั่ง predict() ได้ 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c2th9rngwwuh468acjj0.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cpv3w70larqisgdwgpqv.png)


จากภาพจะเห็นได้ว่าคำตอบค่า y ที่ได้มีความสอดคล้องกับค่า y_train ที่เรากำหนดในตอนแรกถึงแม้จะเพิ่มจำนวนตัวเลขเข้าไปด้วยก็ตาม แสดงให้เห็นว่าโค้ดนี้สามารถทำนายค่าตัวเลขที่โมเดล Linear Regression ทำนายได้
How to approach your application infrastructure
Published: 2023-04-11 15:01:47

Here are some of my thoughts about **DESIGN APP'S INFRASTRUCTURE**.

MAINLY YOU NEED TO HAVE A PERSPECTIVE, In other words you must know the application you are about to work with. what is it's nature? how it handles the data? does it needs to scale? and so on... .
Setting a perspective will guide you and ease your decision making process.

## Some principles for you to follow

1. The application should be able to start and stop without any corruption on the data.
2. You should be able to tell that the app is working or not.
3. You should be able to replicate the app environment.
4. Re-configuring the application should not lead to re-writing it.
5. The data should always be external to all the components using it.
6. Try to reach the ephemeral host concept. meaning that any host should be expendable.

## Here are some questions you need to answer

### 1. How you will handle data? (filesystem, cache and database)

#### The filesystem

And when I say the filesystem I means all the files that the application uses directly from the host, Using those files in business applications usually leads to data lost or complicate the process of scaling or shuting a server down so I would recommend using network filesystem like (nfs) or *storage as a service* solutions like S3 or solutions from others vendors.

#### Cache

Any data you keep for a temporary period of time usually to speed up the transactions or to host some sessions data.
And like the filesystem and for the same reasons it should be external to the servers hosts using solutions like redis and memcached.

### Database

What type of database you will need (SQL, NoSQL) will you host it or use a managed service. As a rule of thumb **If you don't have sensitive data just use a managed database** you will have less headache.

### 2. How you will scale each component?

Is your environment scalable?
One might get asked this question by that management or an audit but how to answer it?
let's ask another question what does you need to scale and when?
Is it your backend or the database or the whole solution?
there are two ways to decide:

#### based on resource utilization

Like CPU and RAM or generally hardware resources.

#### based on custom (metric)

Any custom business event metric like specific pattern of requests that alarm of a huge load requests or an event external to the application.

### 3. How you handle failure? (in all levels infra - database - data - app)

Here you need to know how to handle disaster and have a clair disaster recovery plan (DR) for all levels of your infrastructure.

### 4. How you deal with application starting up and shuting down ?

For the app to make sure of the consistency of the data it needs to properly handle the shutting down to release all the connections and streams.
A arte das coleções em .NET - Intro
Tags: dotnet, csharp, programming, beginners
Published: 2023-04-11 14:45:19

Eu tenho estudado bastante sobre estrutura de dados e coleções em .NET. É incrível como entender o funcionamento e a aplicação de cada uma tem o poder de evoluir significativamente a qualidade do código que escrevemos. Por este motivo, decidi escrever uma série de artigos abordando as diferenças entre elas e quando utilizá-las.

## O que são coleções?

> "Dados semelhantes podem normalmente ser tratados com mais eficiência quando armazenados e manipulados como uma coleção."

Podemos encontrar as coleções na classe System.Array ou nas classes dentro dos _namespaces_: System.Collections, System.Collections.Generic, System.Collections.Concurrent e System.Collections.Immutable. Utilizando-as, teremos acesso aos métodos para adicionar, remover e modificar os elementos contidos em uma coleção.

Os dois tipos principais de coleções são as genéricas (System.Collections.Generic) e as não genéricas (System.Collections). A diferença entre elas é que as genéricas possibilitam criar coleções fortemente tipadas. Para exemplificar, imagine que tenhamos a classe Aluno conforme demonstrado abaixo:
```
public class Aluno
{
    public long Id {get; set;}
    public string Nome {get; set;}
}
```
É possível criar uma coleção de alunos utilizando a nossa classe Aluno como tipo. Sendo assim, teríamos a possibilidade de manipular os itens sem a necessidade de conversão, afastando o tão temido _boxing/unboxing_ entre os tipos. Por este motivo, a Microsoft aconselha a utilização de coleções genéricas sempre que possível pois elas fornecem melhor desempenho e segurança de tipos. 

As coleções concorrentes (System.Collections.Concurrent) permitem operações _thread-safe_ eficientes quando temos acesso à coleção através de múltiplas _threads_ e as imutáveis (System.Collections.Immutable) também são _thread-safe_ e, como o nome diz, esta coleção não pode ser modificada: as operações são feitas em cima de uma cópia da coleção original. 

Para esta série, iremos focar nas coleções genéricas e não genéricas o que vai nos dar muito assunto! 

## Conclusão
As coleções muitas das vezes são tratadas como simples e não damos a devida importância aos tipos e onde se encaixam. Após essa introdução e apresentação sobre coleções no .NET, no próximo post falaremos sobre uma coleção que provavelmente todo mundo já ouviu falar e é muito utilizada: Lista.


#### Referências:
[Collections and Data Structures](https://learn.microsoft.com/en-us/dotnet/standard/collections/)
[Selecting a Collection Class](https://learn.microsoft.com/en-us/dotnet/standard/collections/selecting-a-collection-class)
4 More Unrelated Perl Tidbits
Tags: perl
Published: 2023-04-11 14:39:40

Last year I wrote an article titled [4 Unrelated Perl Tidbits](https://dev.to/nicholasbhubbard/4-unrelated-perl-tidbits-2766), where I talked about some random Perl facts I learned about from reading [Programming Perl](https://www.oreilly.com/library/view/programming-perl-4th/9781449321451/). In this article I will talk about 4 more random and interesting Perl features I have learned about since.

### Built-Ins Can Be Overridden with Lexical Subroutines

Perl version 5.18 introduced [lexical subroutines](https://perldoc.perl.org/perlsub#Lexical-Subroutines), which are often sometimes referred to as "my subs". An interesting characteristic of lexical subs is that unlike regular subroutines, they can override built-ins.

```perl
use v5.18;

my sub print {
    die "printing is banned\n";
}

print "Hello, World!\n";

__END__

$ perl tmp.pl
printing is banned
```

If anybody has seen a use of this feature then please comment below.

### Recursive Anonymous Subroutines With \_\_SUB\_\_

Perl version 5.16 introduced the [\_\_SUB\_\_](https://perldoc.perl.org/functions/__SUB__) special token that holds a reference to the current subroutine. You can use `__SUB__` to make a recursive call in an anonymous subroutine.

```perl
use v5.16;

higher_order_subroutine(
    sub {
        my $n = shift;
        if ($n <= 1) { return 1 }
        else         { return $n * __SUB__->($n-1) }
    }
)
```

### Goto Searches For Labels In The Dynamic Scope

The following example shows that [goto](https://perldoc.perl.org/functions/goto) searches for its label argument from within the current [dynamic scope](https://en.wikipedia.org/wiki/Scope_(computer_science)#Dynamic_scope). Note that this program just goes on forever printing `hello from after LABEL`:

```perl
sub foo {
    bar();
}

sub bar {
    goto LABEL;
}

sub baz {
  LABEL:
    print "hello from after LABEL\n";
    foo();
}

baz();

__END__

$ perl tmp.pl
hello from after LABEL
hello from after LABEL
hello from after LABEL
...
```

This is another feature that you should leave a comment about if you have seen a usage of it.

### Regex Modifier For Only Portions Of The Regex

You can use the `(?M:)` pattern in a regex to turn on the modifier specified by `M`, only inside the parentheses. For example, the following two regexs are the same:

```perl
/foo/i
/(?i:foo)/
```

You can also turn a modifier off with `(?-M:)`, which is shown in this example:

```perl
if ('FOO' =~ /(?-i:foo)/i) {
    print "matches\n"
} else {
    print "does not match\n"
}

__END__

$ perl tmp.pl
does not match
```

This feature is useful if you want to turn a modifier on/off for only a portion of the regex:

```perl
if ('fooBAR' =~ /(?-i:foo)bar/i) {
    print "matches\n"
} else {
    print "does not match\n"
}

__END__

$ perl tmp.pl
matches
```
Introducing the CV Schema Proposal: A More Streamlined Approach to Applicant Information
Tags: json, jsonschema, javascript, career
Published: 2023-04-11 14:11:19

Are you looking for a more efficient and organized way to handle applicant information? The CV Schema Proposal may be just what you need. This JSON format provides a standardized representation of professional history and skills, with properties including contact, education, skills, experience, certifications, and projects. By adhering to established standards and data types, this schema is easy to implement and adapt to different languages and cultures. Enjoy benefits such as uniformity, simplicity, extensibility, adaptability, and efficiency. Join us in exploring the potential of the CV Schema Proposal for a more streamlined hiring process.

{% embed https://github.com/saulodias/cv-schema %}
The ultimate Nuxt3 Vuetify3 setup
Tags: nuxt, vuetify3, vue3, codenewbie
Published: 2023-04-11 14:07:01

[Nuxt 3](https://nuxt.com/docs/getting-started/introduction#introduction) has many advantages and is the best way to harness [Vue 3](https://vuejs.org/guide/introduction.html) awesomeness.

## Create a new Nuxt 3 project
[use the following guide to create a new Nuxt 3 project](https://nuxt.com/docs/getting-started/installation#new-project)
Upon successfully ✨ creating the Nuxt project with v3 template,Next steps:
Enter the project folder that you have just created 
`cd <project_folder>`
Install dependencies using your favourite node package manager 

```
// using npm
npm install 

// using yarn
yarn install 

// using pnpm
pnpm install 
```

Start development server. 

```
// using npm
npm run dev 

// using yarn
yarn dev

// using pnpm
pnpm run dev 
```

![Initial view](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/alq6o9i9ydu8d2a6g6ro.png)

## Add Vuetify 3
[Vuetify 3](https://vuetifyjs.com/en/introduction/why-vuetify/) is powerful Vue Component Framework based on Google’s [Material Design specification](https://material.io) and comes with hundreds of customisation options that fit any style or design; even if it’s not Material.
Add Vuetify to your project and support packages for sass and icons

```
// using npm
npm install vuetify@^3.1.13 sass @mdi/font

// using yarn
yarn add vuetify@^3.1.13 sass @mdi/font

// using pnpm
pnpm install vuetify@^3.1.13 sass @mdi/font
```

## Create Vuetify plugin
There is need to add Vuetify as a [Nuxt plugin](https://nuxt.com/docs/guide/directory-structure/plugins).

Create a _plugins_ folder and create a file named _vuetify.js_ in it.

Add this code snippet in the _vuetify.js_ file:

```js
import { createVuetify } from "vuetify";
import * as components from "vuetify/components";
import * as directives from "vuetify/directives";

export default defineNuxtPlugin((nuxtApp) => {
  const vuetify = createVuetify({
    components,
    directives,
    ssr: true,
  });
  nuxtApp.vueApp.use(vuetify);
});

```
Vue 3 has no way to automatically detect if SSR is used — so nuxt, gridsome, and other SSR frameworks must manually set the ssr option to true in order to properly render the application.

## Add nuxt config
Create nuxt config file with name _nuxt.config.ts_ if it does not exist and add the following config:

```js
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  css: [
     "vuetify/lib/styles/main.sass", 
     "@mdi/font/css/materialdesignicons.css"
  ],
  build: {
    transpile: [
      "vuetify"
    ],
  },
})
```

With this, you should be able to use Vuetify 3 components as you like.

The [demo of the finished setup is here](https://nuxt3-vuetify3-gold.vercel.app) and the [final code can be found here](https://github.com/edcsu/nuxt3-vuetify3).
AI ตรวจจับวัตถุในรูปภาพ โดยใช้ pixellib
Tags: python, ai, machinelearning
Published: 2023-04-11 13:48:31

**Object Detection การตรวจจับวัตถุ คือ?**
เทคโนโลยีในทางคอมพิวเตอร์ หลักการที่เกี่ยวกับ Computer Vision และ Image Processing ที่ใช้ในงาน AI ตรวจจับวัตถุชนิดที่กำหนด เช่น มนุษย์ รถยนต์ อาคาร ที่อยู่ในรูปภาพ หรือวิดีโอ
งาน Object Detection การตรวจจับวัตถุในรูปภาพ สามารถเจาะลึกลงไปได้อีกหลายแขนง เช่น การทำ Face Detection ตรวจจับหน้าคน Pedestrian Detection ตรวจจับคนเดินถนน สามารถประยุกต์ใช้ได้หลากหลาย เช่น ใช้ในงานรักษาความปลอดภัย และรถยนต์ไร้คนขับ เป็นต้น โดยทางเราได้จัดทำเป็น การตรวจจับวัตถุในรูปภาพ โดยใช้ pixellib

**การทำงานของ AI ตรวจจับวัตถุในรูปภาพโดยใช้ pixellib**
https://youtu.be/kc-oYynMAic

**เราจะสร้างใช้ AI ตรวจจับวัตถุในรูปภาพ โดยใช้ pixellib
ติดตั้ง pixellib**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7p9dnpiwg3sgot64xiz.png)

**นำเข้ารูปภาพและ สเกลต่างๆ**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wzliziwjycn9r13tf8vx.png)

**รูปภาพดั้งเดิม ต้นฉบับ**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8tix9fifmg5l580ndzfj.png)

**นำเข้าตัว pixellib ตรวจจับรูปภาพ**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tthmk35smikvmlh6u1bk.png)

**จากนั้นใส่โค้ดตัวแสดงผล **

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y3xftag3kehpjxjmtndu.png)

**ผลลัพธ์ที่ได้นั้นคือ**
รูปภาพเมื่อAI แสดงผลการตรวจจับแล้ว
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yh7fir6gegtc52cvqa4j.png)


รูปภาพดั้งเดิม
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ohtz8xzh9h5mootufgrm.png)


**สรุป** : Object Detection คือ AI ตรวจจับวัตถุ ในงานทางด้าน Computer Vision ที่จะจำแนก และตรวจจับวัตถุที่อยู่ในรูป การตรวจจับ มาร์กจุด มาร์กพื้นที่ โดยหลักการ สามารถทำได้หลายวิธี การทำมาร์กพื้นที่ที่นิยมได้แก่ วาดกล่องรอบวัตถุ (Bounding Box) หรือ ถมสีให้ทุก Pixel ของวัตถุนั้น (เรียกว่า Segmentation)