Skip to content

Instantly share code, notes, and snippets.

View Sachin-crypto's full-sized avatar

Sachin Pal Sachin-crypto

View GitHub Profile
@Sachin-crypto
Sachin-crypto / rotation_img_augmentation.ipynb
Last active August 9, 2023 07:29
rotation_img_augmentation.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Sachin-crypto
Sachin-crypto / append.py
Created March 23, 2023 17:01
A simple demonstration of list append()
# List of names
friends = ['Sachin', 'Rishu', 'Yashwant']
# Printing the original list
print('Original List:', friends)
# Appending an element
friends.append('Abhishek')
# Printing the updated list
print('New List: ', friends)
@Sachin-crypto
Sachin-crypto / extendd.py
Created March 23, 2023 17:00
A simple demonstration of list extend()
# List of names
friends = ['Sachin', 'Rishu', 'Yashwant']
# Printing the original list
print('Original List:', friends)
# Using extend() to extend the list
friends.extend(['Yogesh', 'Abhishek'])
# Printing the updated list
print('New List: ', friends)
@Sachin-crypto
Sachin-crypto / insertt.py
Created March 23, 2023 16:59
A simple demonstration of list insert()
# List of names
friends = ['Sachin', 'Rishu', 'Yashwant']
# Printing the original list
print('Original List:', friends)
# Inserting an element
friends.insert(1, 'Abhishek')
# Printing the updated list
print('New List: ', friends)
@Sachin-crypto
Sachin-crypto / adoption_pet.py
Created March 20, 2023 15:12
A simple python program to adopt a pet and the details will be entered in a file.
'''
A Python program to adopt a pet and appending the details in a file.
The entry can also be viewed by reading the file
'''
import datetime
# Defining main function
def get_pet(pet):
img_input = input("Enter the path of an image: ")
display_and_predict(img_input)
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
# Function to display and predicting the Image
def display_and_predict(img_path_input):
display_img = Image.open(img_path_input)
plt.imshow(display_img)
plt.show()
img = preprocess_img(img_path_input)
pred = predict_result(img)
print("Prediction: ", pred)
img_input = input("Enter the path of an image: ")
display_and_predict(img_input)
def predict_result(predict):
pred = my_model.predict(predict)
return np.argmax(pred[0], axis=-1)