-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBrain.py
22 lines (18 loc) · 1.11 KB
/
Brain.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# First "clone" git repo in our system
# Second we move our files in .git folder
# Third We check the "status", if not not added to repo then,
# Fourth We use "git add <file> or git add ." to add files in load ing process one by one or all at once respectively.
# Fifth We us "git commit -m 'random msg'" to commit the changes in the file with a message (optional)
# Sixth We use "git push" to upload in the repo final step
# To check if any other person have made any sort of change in our file we use "git pull"
# To save any change in file first "git add ." then "git commit" then "git push" to upload the changes
from imageai.Classification import ImageClassification
import os
execution_path = os.getcwd()
prediction = ImageClassification()
prediction.setModelTypeAsDenseNet121()
prediction.setModelPath(os.path.join(execution_path, "densenet121-a639ec97.pth"))
prediction.loadModel()
predictions, probabilities = prediction.classifyImage(os.path.join(execution_path, "giraffe.jpg"), result_count = 7 )
for eachPrediction, eachProbability in zip(predictions, probabilities):
print(eachPrediction , " : " , eachProbability)