Skip to content

Commit

Permalink
Update for Copilot Free (#247)
Browse files Browse the repository at this point in the history
* docs: Clarify prerequisites

* docs: Update reference links to newer docs
  • Loading branch information
chriswblake authored Dec 18, 2024
1 parent b4773f8 commit c469494
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/steps/X-finish.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Here's a recap of all the tasks you completed:

### Additional learning and resources

This comment has been minimized.

Copy link
@habibur337

habibur337 Jan 19, 2025

import cv2 # Library for openCV
import threading # Library for threading -- which allows code to run in backend
import playsound # Library for alarm sound
import smtplib # Library for email sending

To access xml file which includes positive and negative images of fire.

(Trained images) File is also provided with the code.

fire_cascade = cv2.CascadeClassifier('fire_detection_cascade_model.xml')

vid = cv2.VideoCapture("videos\fire2.mp4")
runOnce = False # created boolean

defined function to play alarm post fire detection using threading

def play_alarm_sound_function():
# to play alarm # mp3 audio file is also provided with the code.
playsound.playsound('fire_alarm.mp3',True)
print("Fire alarm end") # to print in consol

Defined function to send mail post fire detection using threading

def send_mail_function():

recipientmail = "add recipients mail" # recipients mail
recipientmail = recipientmail.lower() # To lower case mail

try:
    server = smtplib.SMTP('smtp.gmail.com', 587)
    server.ehlo()
    server.starttls()
    # Senders mail ID and password
    server.login("add senders mail", 'add senders password') 
    # recipients mail with mail message
    server.sendmail('add recipients mail', recipientmail, "Warning fire accident has been reported") 
     # to print in consol to whome mail is sent
    print("Alert mail sent sucesfully to {}".format(recipientmail))
    server.close() ## To close server
    
except Exception as e:
    print(e) # To print error if any

while(True):
Alarm_Status = False
# Value in ret is True # To read video frame
ret, frame = vid.read()
# To convert frame into gray color
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# to provide frame resolution
fire = fire_cascade.detectMultiScale(frame, 1.2, 5)

## to highlight fire with square 
for (x,y,w,h) in fire:
    cv2.rectangle(frame,(x-20,y-20),(x+w+20,y+h+20),(255,0,0),2)
    roi_gray = gray[y:y+h, x:x+w]
    roi_color = frame[y:y+h, x:x+w]

    print("Fire alarm initiated")
    # To call alarm thread
    threading.Thread(target=play_alarm_sound_function).start()  

    if runOnce == False:
        print("Mail send initiated")
        # To call alarm thread
        threading.Thread(target=send_mail_function).start() 
        runOnce = True
    if runOnce == True:
        print("Mail is already sent once")
        runOnce = True

cv2.imshow('frame', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
    break
- [Copilot for Individuals](https://docs.github.com/en/copilot/overview-of-github-copilot/about-github-copilot-for-individuals)
- [Copilot for Business](https://docs.github.com/en/copilot/overview-of-github-copilot/about-github-copilot-for-business)
- [What is GitHub Copilot](https://docs.github.com/en/copilot/about-github-copilot/what-is-github-copilot)
- [About enterprise accounts for Copilot Business](https://docs.github.com/en/enterprise-cloud@latest/admin/copilot-business-only/about-enterprise-accounts-for-copilot-business)
- [Getting started with Copilot](https://docs.github.com/en/copilot/getting-started-with-github-copilot/getting-started-with-github-copilot-in-visual-studio-code)
- [Configure Copilot settings](https://docs.github.com/en/copilot/configuring-github-copilot/configuring-github-copilot-settings-on-githubcom)

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ GitHub Copilot can help you code by offering autocomplete-style suggestions. You
- **Who this is for**: Developers, DevOps Engineers, Software development managers, Testers.
- **What you'll learn**: How to install Copilot into a Codespace, accept suggestions from code, accept suggestions from comments.
- **What you'll build**: Javascript files that will have code generated by Copilot AI for code and comment suggestions.
- **Prerequisites**: To use GitHub Copilot you must have an active GitHub Copilot subscription. Sign up for 30 days free [Copilot](https://github.com/settings/copilot).

This comment has been minimized.

Copy link
@MariMaria604

MariMaria604 Jan 15, 2025

can u help me to set it up

This comment has been minimized.

Copy link
@MariMaria604

MariMaria604 Jan 15, 2025

please

- **Prerequisites**:
- [GitHub account](https://github.com/login) - With available Codespaces minutes.
- [GitHub Copilot](https://github.com/github-copilot/signup) - For learning, the **Copilot Free** option with usage limits should be sufficient.
- **Timing**: This course can be completed in under an hour.

This comment has been minimized.

Copy link
@ptownaround

ptownaround Dec 28, 2024

Open portal to device for remote acess

This comment has been minimized.

Copy link
@Mark-Nichols-7

Mark-Nichols-7 Jan 5, 2025

have know idea

This comment has been minimized.

Copy link
@Mark-Nichols-7

Mark-Nichols-7 Jan 5, 2025

still nothing I'm 62

  • [ ]
### How to start this course
Expand Down

6 comments on commit c469494

@ZMZ2025
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment utelissares copilot

@asmaa-2004
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi

@m-arc1276
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slm

@pawanraoadvocate
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi

@ULINIKEN3020
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hii there

@Ramahdyn
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hiii

Please sign in to comment.