Hussein El-Hadidy commited on
Commit
29edd2d
·
1 Parent(s): f318afc

Changed Scikit learn to 1.2.2 From 1.6.1

Browse files
Files changed (4) hide show
  1. __pycache__/main.cpython-313.pyc +0 -0
  2. app.py +6 -5
  3. main.py +6 -5
  4. requirements.txt +1 -1
__pycache__/main.cpython-313.pyc CHANGED
Binary files a/__pycache__/main.cpython-313.pyc and b/__pycache__/main.cpython-313.pyc differ
 
app.py CHANGED
@@ -96,8 +96,9 @@ async def predict_burn(file: UploadFile = File(...)):
96
  temp_file.write(await file.read())
97
 
98
  # Upload the file to Cloudinary
99
- upload_result = cloudinary.uploader.upload(temp_file_path, public_id=f"predict_{file.filename}")
100
- cloudinary_url = upload_result["secure_url"]
 
101
 
102
  # Load the saved SVM model
103
  with open('svm_model.pkl', 'rb') as model_file:
@@ -127,9 +128,9 @@ async def predict_burn(file: UploadFile = File(...)):
127
  prediction_label = "Zero Class"
128
 
129
  # Save result to MongoDB
130
- collection = db["Predictions"]
131
- doc = {"filename": file.filename, "url": cloudinary_url, "prediction": prediction_label}
132
- collection.insert_one(doc)
133
 
134
  return {
135
  "prediction": prediction_label,
 
96
  temp_file.write(await file.read())
97
 
98
  # Upload the file to Cloudinary
99
+ #upload_result = cloudinary.uploader.upload(temp_file_path, public_id=f"predict_{file.filename}")
100
+ #cloudinary_url = upload_result["secure_url"]
101
+ cloudinary_url = "https:facebook.com"
102
 
103
  # Load the saved SVM model
104
  with open('svm_model.pkl', 'rb') as model_file:
 
128
  prediction_label = "Zero Class"
129
 
130
  # Save result to MongoDB
131
+ #collection = db["Predictions"]
132
+ #doc = {"filename": file.filename, "url": cloudinary_url, "prediction": prediction_label}
133
+ #collection.insert_one(doc)
134
 
135
  return {
136
  "prediction": prediction_label,
main.py CHANGED
@@ -96,8 +96,9 @@ async def predict_burn(file: UploadFile = File(...)):
96
  temp_file.write(await file.read())
97
 
98
  # Upload the file to Cloudinary
99
- upload_result = cloudinary.uploader.upload(temp_file_path, public_id=f"predict_{file.filename}")
100
- cloudinary_url = upload_result["secure_url"]
 
101
 
102
  # Load the saved SVM model
103
  with open('svm_model.pkl', 'rb') as model_file:
@@ -127,9 +128,9 @@ async def predict_burn(file: UploadFile = File(...)):
127
  prediction_label = "Zero Class"
128
 
129
  # Save result to MongoDB
130
- collection = db["Predictions"]
131
- doc = {"filename": file.filename, "url": cloudinary_url, "prediction": prediction_label}
132
- collection.insert_one(doc)
133
 
134
  return {
135
  "prediction": prediction_label,
 
96
  temp_file.write(await file.read())
97
 
98
  # Upload the file to Cloudinary
99
+ #upload_result = cloudinary.uploader.upload(temp_file_path, public_id=f"predict_{file.filename}")
100
+ #cloudinary_url = upload_result["secure_url"]
101
+ cloudinary_url = "https:facebook.com"
102
 
103
  # Load the saved SVM model
104
  with open('svm_model.pkl', 'rb') as model_file:
 
128
  prediction_label = "Zero Class"
129
 
130
  # Save result to MongoDB
131
+ #collection = db["Predictions"]
132
+ #doc = {"filename": file.filename, "url": cloudinary_url, "prediction": prediction_label}
133
+ #collection.insert_one(doc)
134
 
135
  return {
136
  "prediction": prediction_label,
requirements.txt CHANGED
@@ -71,7 +71,7 @@ PyYAML==6.0.2
71
  requests==2.32.3
72
  rich==14.0.0
73
  scikit-image==0.25.2
74
- scikit-learn==1.6.1
75
  scipy==1.15.2
76
  seaborn==0.13.2
77
  six==1.17.0
 
71
  requests==2.32.3
72
  rich==14.0.0
73
  scikit-image==0.25.2
74
+ scikit-learn==1.2.2
75
  scipy==1.15.2
76
  seaborn==0.13.2
77
  six==1.17.0