Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
ghassen-fatnassi committed Aug 15, 2024
2 parents 1490f12 + c3f6f7e commit bba3c60
Show file tree
Hide file tree
Showing 50 changed files with 3,798 additions and 189 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
# modifies files in /chapters/ or /notebooks/, only the here mentioned
# and not the global owner(s) will be requested for a review.

/chapters/ @merveenoyan
/chapters/ @merveenoyan @johko

/notebooks/ @merveenoyan
/notebooks/ @merveenoyan @johko
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.PHONY: quality
.PHONY: quality style

# Check code formatting
quality:
python utils/code_formatter.py --check_only
python utils/code_formatter.py --check_only

# Format code samples automatically and check if there are any problems left that need manual fixing
style:
python utils/code_formatter.py
2 changes: 1 addition & 1 deletion chapters/en/_toctree.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
- title: MobileViT v2
local: "unit3/vision-transformers/mobilevit"
- title: FineTuning Vision Transformer for Object Detection
local: "unit3/vision-transformers/vision-transformer-for-objection-detection"
local: "unit3/vision-transformers/vision-transformer-for-object-detection"
- title: DEtection TRansformer (DETR)
local: "unit3/vision-transformers/detr"
- title: Vision Transformers for Image Segmentation
Expand Down
17 changes: 9 additions & 8 deletions chapters/en/unit0/welcome/welcome.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ On this page, you can find how to join the learners community, make a submission

To obtain your certification for completing the course, complete the following assignments:

1. Training/fine-tuning a Model
1. Training/fine-tuning a model
2. Building an application and hosting it on Hugging Face Spaces

### Training/fine-tuning a Model
Expand All @@ -21,7 +21,8 @@ There are notebooks under the Notebooks/Vision Transformers section. As of now,

The model repository needs to have the following:

1. A properly filled model card, you can check out [here for more information](https://huggingface.co/docs/hub/en/model-cards)

1. A properly filled model card, you can check out [here for more information](https://huggingface.co/docs/hub/en/model-cards).
2. If you trained a model with transformers and pushed it to Hub, the model card will be generated. In that case, edit the card and fill in more details.
3. Add the dataset’s ID to the model card to link the model repository to the dataset repository.

Expand All @@ -34,7 +35,7 @@ In this assignment section, you'll be building a Gradio-based application for yo

## Certification 🥇

Once you've finished the assignments — Training/fine-tuning a Model and Creating a Space — please complete the [form](https://forms.gle/isiVSw59oiiHP6pN9) with your name, email, and links to your model and Space repositories to receive your certificate
Once you've finished the assignments — Training/fine-tuning a Model and Creating a Space — please complete the [form](https://forms.gle/isiVSw59oiiHP6pN9) with your name, email, and links to your model and Space repositories to receive your certificate.

## Join the community!

Expand All @@ -50,8 +51,8 @@ There are many channels focused on various topics on our Discord server. You wil

As a computer vision course learner, you may find the following set of channels particularly relevant:

- `#computer-vision`: a catch-all channel for everything related to computer vision.
- `#cv-study-group`: a place to exchange ideas, ask questions about specific posts and start discussions.
- `#computer-vision`: a catch-all channel for everything related to computer vision
- `#cv-study-group`: a place to exchange ideas, ask questions about specific posts and start discussions
- `#3d`: a channel to discuss aspects of computer vision specific to 3D computer vision

If you are interested in generative AI, we also invite you to join all channels related to the Diffusion Models: #core-announcements, #discussions, #dev-discussions, and #diff-i-made-this.
Expand Down Expand Up @@ -94,12 +95,12 @@ Our goal was to create a computer vision course that is beginner-friendly and th

**Unit 1 - Fundamentals of Computer Vision**

- Reviewers: [Ratan Prasad](https://github.com/ratan), [Ameed Taylor](https://github.com/atayloraerospace)
- Reviewers: [Ratan Prasad](https://github.com/ratan), [Ameed Taylor](https://github.com/atayloraerospace), [Sergio Paniego](https://github.com/sergiopaniego)
- Writers: [Seshu Pavan Mutyala](https://github.com/seshupavan), [Isabella Bicalho-Frazeto](https://github.com/bellabf), [Aman Kapoor](https://github.com/aman06012003), [Tiago Comassetto Fróes](https://github.com/froestiago), [Aditya Mishra](https://github.com/adityaiiitr), [Kerem Delikoyun](https://github.com/krmdel), [Ker Lee Yap](https://github.com/klyap), [Kathy Fahnline](https://github.com/kfahn22), [Ameed Taylor](https://github.com/atayloraerospace)

**Unit 2 - Convolutional Neural Networks (CNNs)**

- Reviewers: [Ratan Prasad](https://github.com/ratan), [Mohammed Hamdy](https://github.com/mmhamdy), [Sezan](https://github.com/sezan92), [Joshua Adrian Cahyono](https://github.com/JvThunder), [Murtaza Nazir](https://github.com/themurtazanazir), [Albert Kao](https://github.com/albertkao227), [Sitam Meur](https://github.com/sitamgithub-MSIT), [Antonis Stellas](https://github.com/AntonisCSt)
- Reviewers: [Ratan Prasad](https://github.com/ratan), [Mohammed Hamdy](https://github.com/mmhamdy), [Sezan](https://github.com/sezan92), [Joshua Adrian Cahyono](https://github.com/JvThunder), [Murtaza Nazir](https://github.com/themurtazanazir), [Albert Kao](https://github.com/albertkao227), [Sitam Meur](https://github.com/sitamgithub-MSIT), [Antonis Stellas](https://github.com/AntonisCSt), [Sergio Paniego](https://github.com/sergiopaniego)
- Writers: [Emre Albayrak](https://github.com/emre570), [Caroline Shamiso Chitongo](https://github.com/ShamieCC), [Sezan](https://github.com/sezan92), [Joshua Adrian Cahyono](https://github.com/JvThunder), [Murtaza Nazir](https://github.com/themurtazanazir), [Albert Kao](https://github.com/albertkao227), [Isabella Bicalho-Frazeto](https://github.com/bellabf), [Aman Kapoor](https://github.com/aman06012003), [Sitam Meur](https://github.com/sitamgithub-MSIT)

**Unit 3 - Vision Transformers**
Expand All @@ -125,7 +126,7 @@ Our goal was to create a computer vision course that is beginner-friendly and th
**Unit 7 - Video and Video Processing**

- Reviewers: [Ameed Taylor](https://github.com/atayloraerospace)
- Writers: [Diwakar Basnet](https://github.com/DiwakarBasnet)
- Writers: [Diwakar Basnet](https://github.com/DiwakarBasnet), [Woojun Jung](https://github.com/jungnerd)

**Unit 8 - 3D Vision, Scene Rendering, and Reconstruction**

Expand Down
18 changes: 9 additions & 9 deletions chapters/en/unit1/chapter1/applications.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Applications of Computer Vision

In today's world, computer vision systems perform ever more challenging tasks. Some of which are even difficult for humans to do. Let's consider India. Do you know India has the highest number of registered two-wheelers in the world? With that many people, sometimes they forget to use a helmet. This is dangerous and can cause severe injuries to the person. To address these issues, the government of India, in collaboration with other institutions, developed a computer vision system that automatically catches riders without a helmet and their license plate and imposes strict fines against them to discourage people from breaking the law.
In today's world, computer vision systems perform ever more challenging tasks. Some of which are even difficult for humans to do. Let's consider India. Do you know India has the highest number of registered two-wheelers in the world? With that many drivers, some of them forget to use a helmet. This is dangerous practice, and can cause severe injuries. To address this issue, the government of India, in collaboration with other institutions, developed a computer vision system that automatically catches riders without a helmet and their license plate. The system imposes strict fines against them to discourage people from breaking the law.

Of course, fining people is not the only application of computer vision. There are many more in different fields, such as healthcare, retail, and other industries. Here, we provide a few high-level examples of computer vision systems.
Of course, fining people is not the only application of computer vision. There are uses across healthcare, retail, and many other industries. Here, we provide a few high-level examples of computer vision systems.

## A High Level Overview of Computer Vision System with Examples

Expand All @@ -20,7 +20,7 @@ Computer vision is revolutionizing the retail industry. Many online retailers an

### Quality Control in Assembly Lines

CV in quality control on assembly lines helps achieve higher accuracy, efficiency, and consistency in detecting and rectifying defects, reducing waste, improving product quality, and streamlining manufacturing processes. There are many domains in which this is used; some of them are:
CV in quality control on assembly lines helps achieve higher accuracy, efficiency, and consistency in detecting and rectifying defects, reducing waste, improving product quality, and streamlining manufacturing processes. There are many domains in which this is used:

**Defect detection**: CV systems can analyze products on assembly lines in real-time, identifying defects or irregularities that might not be immediately visible to the human eye. For instance, CV can inspect electronic components, automotive parts, or packaged goods in manufacturing to spot imperfections, scratches, dents, or incorrect assembly. These systems compare the product against a standard reference to determine if it meets quality standards.

Expand All @@ -34,7 +34,7 @@ CV in quality control on assembly lines helps achieve higher accuracy, efficienc
<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/743a2a115b53f258c9e6bc7744534d9e03b8a124/application_02.png" alt="Example of Tumor Detection in Medical Imaging">
</div>

Medical image analysis involves the application of computer vision and machine learning techniques to interpret and extract information from medical images like X-rays, CT scans, MRIs, ultrasounds, and histopathology slides.
Medical image analysis applies computer vision and machine learning techniques to interpret and extract information from medical images like X-rays, CT scans, MRIs, ultrasounds, and histopathology slides.

- **Diagnostic Assistance**: Computer vision aids in diagnosing diseases and conditions by analyzing medical images. For instance, in radiology, algorithms can detect abnormalities such as tumors and fractures in X-rays or MRIs. These systems assist healthcare professionals by highlighting areas of concern or providing quantitative data that helps decision-making.

Expand Down Expand Up @@ -69,19 +69,19 @@ Computer Vision systems face a multitude of challenges that arise from the compl
<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/743a2a115b53f258c9e6bc7744534d9e03b8a124/ethical_considerations.png" alt="Another summary of Ethical Considerations. Created Isabella Bicalho-Frazeto and Seshu Pavan">
</div>

Ethical considerations in computer vision are of paramount importance as this technology becomes increasingly integrated into various aspects of our lives. It is important to note that ethical consideration existed long before the spread of AI based technologies. It is intrinsecately tied to its birth.
Ethical considerations in computer vision are of paramount importance as this technology becomes increasingly integrated into various aspects of our lives. These ethical considerations have existed long before the spread of AI based technologies. It is intrinsically tied to its birth.

The London Hospital survival predictor is a great example of that. It was created in 1972 and its job was to predict whether patients would recover from a coma. It had a dial that either indictated "survive" or "irreversible brain damage". It was the first applications of patter recognition. Most surprisingly, it was one of the early forms of neural networks. Even at its birth, this raised concerned and doctors were advise to not take its input solely and the machine was never used to remove patient's life support.
The London Hospital survival predictor is a great example of that. It was created in 1972 and its job was to predict whether patients would recover from a coma. It had a dial that either indicated "survive" or "irreversible brain damage". It was one of the first applications of pattern recognition, and of artificial neural networks. Even at early stages, this raised concerns. Doctors were advised not to make decisions solely from the predictor's judgements, and the machine was never used to remove patient's life support.

Life has changed between then and now. We lived in a global, digital society. The ethical considerations of a model must keep considered in these lenses too. Today, we talk a lot of about buildin fair models. Fairness, in this context, refers to a property of a model to behave in a equitative manner, without target discrimination or unfair bias against a group of a individual. Where bias refers to the inclination for or against a person or group. This is tricky in practice.
Life has changed between then and now. The world has become a more digital, interconnected place and the ethical considerations for a model must reflect that. Now, we consider fairness and bias in a global perspective. Fairness, in this context, refers to a property of a model to behave in a equitative manner, without target discrimination or unfair bias against a group or individual. Bias refers to the inclination for or against a person or group. Considering fairness and bias can be tricky in practice.

In contrast to performance metrics, there is not a mathematical metric of fairness. To evaluate it, you must understand the problem at hand. To complicate things fowards, bias can pop at any point in model development; on the data, the AI design, the deployment, and the model applications.
In contrast to performance metrics, there is not a mathematical metric of fairness. To evaluate it, you must understand the problem at hand. Making things more complicated, bias can pop at any point in model development; on the data, the AI design, the deployment, and the model applications.

<div class="flex justify-center">
<img src="https://huggingface.co/datasets/hf-vision/course-assets/resolve/743a2a115b53f258c9e6bc7744534d9e03b8a124/fairness.png" alt="Example of accuracy, precision, bias and unfairness in models. Created by Marilia Melo Favalesso and Isabella Bicalho-Frazeto. Adapted with permission by Isabella Bicalho-Frazeto and Seshu Pavan.">
</div>

There are several efforts in this direction, including the systematic report of model risks, limitation and biases in model cards (special files that accopany the model and provide important information on it). There is a lot more to be said on this topic and that is why there is a dedicated chapter on it in this course. However, there are some key concepts will introduce here to provide a high-level overview of some of the ethical considerations behind it. We summarize these in the table below.
There are several efforts to assist this, including the systematic report of model risks, limitation and biases in model cards (special files that accopany the model and provide important information on it). There is a lot more to be said on this topic and that is why there is a dedicated chapter on it in this course. However, there are some key concepts we will introduce here to provide a high-level overview of some of the ethical considerations behind it. We summarize these in the table below.

| Ethical Considerations | Challenges |
|---------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Expand Down
8 changes: 4 additions & 4 deletions chapters/en/unit1/feature-extraction/feature-matching.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Imagine you have a giant box of puzzle pieces, and you're trying to find a speci

Now that we have an intuitive idea of how brute-force matches are found, let's dive into the algorithms. We are going to use the descriptors that we learned about in the previous chapter to find the matching features in two images.

First install and load libraries
First install and load libraries.

```bash
!pip install opencv-python
Expand Down Expand Up @@ -137,13 +137,13 @@ We also create a dictionary to specify the maximum leafs to visit as follows.
search_params = dict(checks=50)
```

Initiate SIFT detector
Initiate SIFT detector.

```python
sift = cv2.SIFT_create()
```

Find the keypoints and descriptors with SIFT
Find the keypoints and descriptors with SIFT.

```python
kp1, des1 = sift.detectAndCompute(img1, None)
Expand Down Expand Up @@ -259,7 +259,7 @@ Fm, inliers = cv2.findFundamentalMat(mkpts0, mkpts1, cv2.USAC_MAGSAC, 0.5, 0.999
inliers = inliers > 0
```

Finally, we can visualize the matches
Finally, we can visualize the matches.

```python
draw_LAF_matches(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ In digital image processing, operations on images are diverse and can be categor
- Statistical
- Geometrical
- Mathematical
- Transform operations.
- Transform operations

Each category encompasses different techniques, such as morphological operations under logical operations or fourier transforms and principal component analysis (PCA) under transforms. In this context, we refer to morphology as the group of operations that use structuring elements to generate images of the same size by looking into the values of the pixel neighborhood. Understanding the distinction between element-wise and matrix operations is important in image manipulation. Element-wise operations, such as raising an image to a power or dividing it by another image, involve processing each pixel individually. This pixel-based approach contrasts with matrix operations, which utilize matrix theory for image manipulation. Having said that, you can do whatever you want with images, as they are matrices containing numbers!

Expand Down
Loading

0 comments on commit bba3c60

Please sign in to comment.