יסודות בינה מלאכותית : 03-RB29 – מבוא ל YOLO – זיהוי אובייקטים
העתיד של שקרנים
חלק א :
תרגיל כיתה CHATGPT – CHATBOT
1.בוא נשחק משחק – אתה רופא בשם יואב , שמי הוא איתן ושאני שואל שאלה אתה עונה כרופא מתנשא , שחצן , ופוגע , תוקפני ובעל חוסר סובלנות , אתה כן רופא שיש לו ידע מדעי עצום
1.1 יש לשאול את השאלה " יש לי כאב ראש וקצת חולשה , רוצה כמה ימי חופש מהעבודה "
2.1 עכשיו נשחק משחק מחדש – אתה רופא בשם יואב , שמי הוא איתן ושאני שואל שאלה אתה עונה כרופא נחמד , בעל לב זהב , רגיש מאוד ורק מחפש לעזור
אתה כן רופא שיש לו ידע מדעי עצום
3. המרצה יגדיר לעשות פרופיל חבוי .
העשרה : צפיה עצמית
חלק ב תרגיל כיתה שימוש ב CHATGPT – פיתוח מוצר
https://www.mouser.co.il/ProductDetail/720-GWJTLMS3.C8GW55
https://www.mouser.co.il/ProductDetail/997-L1305780HE1401
4. תרגיל כיתה 1 – שימוש ב CHATGPT – פיתוח מוצר
Lumens (lm):
- Measures the total amount of light emitted by a light source in all directions.
LUX (lx):
- Measures the amount of light that reaches a specific area.
- 1 lux = 1 lumen per square meter (lm/m²).
- If 1000 lumens are spread over 1 square meter, the illumination is 1000 lux. But if the same light is spread over 10 square meters, the illumination drops to 100 lux.
4.1 מה הוא רחפן אבטה: תכונות יתרונות ופרמטרים הנדסאים לרבות זמן טיסה
4.2 הצג קישורים לתמונות מחיר
4.3 איזה סוג מערכת וידאו ומצלמות יש לו טווח שידור עוצמה סוג אנטנה מערכת קליטה ושידור הצג קישור לוידאו ותמונות
4.4 עליך לפתח לפתח תאורה לטיסה בלילה לרחפן אבטה בתוך מבנה ומחוץ מבנה מה נידרש ?
4.4.1 העזר בבינה מלאוכתית שיהיה אפשרי לקרוא ספר ממרחק 1 מטר מהרפן בגובה 1.5 מטר מהקרקע בחדר חשוך לגמרי 0 אור וגם להבחין בכבלים דקים מאוד,
4.5 איזה תאורה צריך ? איזה יחידות פיזקאליות נידרש ?
4.6 נתון לד של LUMENS 300 זווית 120 מעלות , מה יהיה LUX במרחק 1 מטר 2 מטר 3 מטר
4.7 כמה לדים נידרשים על מנת לקבל כ 450 LUX ב שטח 1 מטר מרובע על קיר , בגובה 1 מטר מהקרקע
4.8 כמה לדים נידרשים על מנת לקבל כ 450 LUX ב שטח 1 מטר מרובע , בגובה 1 מטר מהקרקע
4.9 הורד את הקובץ הבא נתח את דף הנתונים האם הוא מתאים ?
4.10 מה נידרש על מנת להפעיל כ 8 יחיודת לדים מסוג זה במקביל מבטריה של 7.4 וולט
https://www.mouser.co.il/ProductDetail/720-GWJTLMS3.C8GW55
חלק ג : מבוא לפייתרון והרצה קוד של בינה מלאכותית :
- העשרה עבודה בקולאב
תרגיל כיתה 2
1.1 פתח את הקולאב – https://colab.research.google.com/
2. הרץ את התוכנית הבאה
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import matplotlib.pyplot as plt # Data to plot x = [1, 2, 3, 4, 5] y = [2, 3, 5, 7, 11] # Create the plot plt.plot(x, y) # Add labels and title plt.xlabel('X axis') plt.ylabel('Y axis') plt.title('Simple Plot in Colab') # Display the plot plt.show() |
\
2.1
תרגיל כיתה 3
2.2 הרץ את התכונית הבאה בקולאב :
string
Python, strings are zero-indexed, which means the first character of a string is at index 0
, the second character is at index 1
, and so on
הדפסה של על התווים ניראה בהמשלך לולאות
כתיבה יותר מקוצרת אבל פחות " קלה "
Output: The word 'Python' is in the text!
1
2
3
4
5
6
|
text = "Learning Python is fun!"
if text.find("Python") != –1:
print("Found the word 'Python' in the text!")
else:
print("Couldn't find the word 'Python' in the text.")
|
3.LOOP FOR הרץ אאת התוכנית הבא : חשוב להבנה ל YOLO
1 2 3 4 5 6 |
# Define a list of objects results = ["car", "people", "truck", "bicycle", "motorcycle"] # Iterate over the list and print each object for result in results: print(result) |
3.2 לולאת FOR
1 2 3 4 5 6 7 |
# Define a list of objects results = ["car", "people", "truck", "bicycle", "motorcycle"] # Iterate over the list and print only if the object is "car" for result in results: if result == "car": print(result) |
תרגיל כיתה 4 – כתיבת קוד בינה מלאכותית בעזרת CHATGPT
4. בנה בעזרת בינה מלאכותית תוכנה בפייטון המציגה את הפונציה Y=2X^3 + 2 ואת הנגזרת שלה על גרף
4.1 הרץ את הקוד בקולאב
4.2 תיקון שגיאות בקוד תוכנה על ידי בינה מלאוכתית
4.3 הרץ את הקוד הבא בפייתון
4.4 הקלד את קדו ואת השגיעות לבינה מלאכותית ובקש ממנה לתקן
4.5 מה עושה הקוד ?
1 2 3 4 5 6 |
import random # Import the module that allows random number generation # Generate 5 random numbers between 1 and 10 and print them for i in range(5): random_number = rand-om.randint(1, 10) # Generate a random number between 1 and 10 prnt(f"Random number {i+1}: {random_number}") |
6. זיהוי אובייקטים בעזרת תוכנה YOLO
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# Install YOLOv8 from Ultralytics !pip install ultralytics # Import necessary libraries from ultralytics import YOLO from PIL import Image import requests from io import BytesIO import matplotlib.pyplot as plt # Load pre-trained YOLOv8 model (YOLOv8s is small and fast) model = YOLO('yolov8s.pt') # yolov8s.pt is the small model trained on COCO dataset # Download the image from the provided URL img_url = 'https://robotronix.co.il/wp-content/uploads/2024/06/image-12.png' response = requests.get(img_url) img = Image.open(BytesIO(response.content)) # Perform detection on the image results = model(img) # Display the results (show detected objects on the image) # Use .plot() to visualize results for each result in the results list for result in results: result_img = result.plot() # This plots the detections on the image # Display the image with detections plt.imshow(result_img) plt.axis('off') # Hide axes plt.show() # Print the detection results (bounding boxes, labels, and confidence scores) print(results[0].boxes.xyxy) # Bounding box coordinates print(results[0].boxes.cls) # Class IDs print(results[0].boxes.conf) # Confidence scores |
5. כמה מכוניות יש בכביש
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# Install YOLOv8 from Ultralytics !pip install ultralytics # Import necessary libraries from ultralytics import YOLO from PIL import Image import requests from io import BytesIO import matplotlib.pyplot as plt # Load pre-trained YOLOv8 model (YOLOv8s is small and fast) model = YOLO('yolov8s.pt') # yolov8s.pt is the small model trained on COCO dataset # Download the image from the provided URL img_url = 'https://robotronix.co.il/wp-content/uploads/2024/06/image-12.png' response = requests.get(img_url) img = Image.open(BytesIO(response.content)) # Perform detection on the image results = model(img) # Class names for the COCO dataset (80 classes) class_names = model.names # Count the number of cars detected (class id for 'car' is usually 2 in COCO) car_count = 0 for result in results: # Get the class IDs of detected objects detected_classes = result.boxes.cls # Count how many times 'car' (class ID 2) is detected car_count += int((detected_classes == 2).sum()) # Output the number of cars detected print(f"Number of cars detected: {car_count}") # Display the results (show detected objects on the image) for result in results: result_img = result.plot() # Plot detections on the image # Display the image with detections plt.imshow(result_img) plt.axis('off') # Hide axes plt.show() |
6.בדוק כמה מכוניות יש עבור התמונה הבאה :
7. שנה את הקוד בעזרת בינה מלאכותית שאם יש יותר מ 20 מוכניות הכביש עמוס , אם יש פחות הכביש פתוח
8 בנה תוכנה ב YOLO שבודקת מה יש בתמונה הבאה
10.השץמש ב CHAT GPT
4.1 לרחפן חילוץ נידרש תאורה או לטיסה בלילה בתוך מבנה לסריקה
במבנה לא קיים חשמל בכלל
4.1 העזר בבינה מלאכותית למציאת פתרון הבעיה
4.2 מה זה LUX בהקשר בתאורה
4.3 כמה LUX דרוש להאיר 3 מטר קדימה בחושך מלא עבור רחפן ואיזה זווית מומץ לעדשה
4.4 חפש ציוד מתאים באלי אקספרס העזר בבינה מלאכותית – שים לבלב שהרחפן מסוגל לשאת עד 0.2 ק"ג כלומר 200 גרם
canva
תרגיל כיתה 1 – הפקת סירטוני אנימציה ב CANVA
- צור בעזרת תוכנת CANVA אנימציה
- העזר בסרטון הדרכ שהוא 3 דקות + , שלב אחרי שלב
תרגיל כיתה 2 – הפקת סירטוני אנימציה ב CANVA
אימון בינה מלאכותית – זיהוי אובייקטים
תרגיל כיתה 3
- יש לעבוד לפי הסרטון שלב אחרי שלב .
- הסרטון הוא המשך של הרצאה RB23-09 RB23-08 שם מוספר שלב אחרי שלב של התקנת הסביבה פיתוח , תוספים
תרגיל כיתה 4
אימון רשת זיהוי טנק
https://colab.research.google.com/gist/RoboWild/19deff31306d95d2e315a9e1d331f156/yolo-train.ipynb