This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma circom 2.0.0; | |
include "../node_modules/circomlib/circuits/poseidon.circom"; | |
include "../node_modules/circomlib/circuits/comparators.circom"; | |
include "../node_modules/circomlib/circuits/gates.circom"; | |
template CreditProof() { | |
signal input creditScore; | |
signal input minCreditScore; | |
signal input maxCreditScore; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma circom 2.0.0; | |
include "../node_modules/circomlib/circuits/poseidon.circom"; | |
include "../node_modules/circomlib/circuits/comparators.circom"; | |
template AgeProof() { | |
signal input doBTimestamp; // Timestamp of the DoB in seconds | |
signal input address; // Address of the user | |
signal input currentTimestamp; // Current time in seconds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
import "@openzeppelin/contracts/access/Ownable.sol"; | |
contract DIdentity is Ownable { | |
struct Identity { | |
bytes32 UID; | |
bytes32 nameHash; // keccak256 hash of name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tensordash.tensordash import Customdash | |
histories = Customdash( | |
ModelName = '<YOUR_MODEL_NAME>', | |
email = '<YOUR_EMAIL_ID>', | |
password = '<YOUR PASSWORD>') | |
try: | |
for epoch in range(num_epochs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tensordash.fastdash import Fastdash | |
my_cb = Tensordash( | |
ModelName = '<YOUR_MODEL_NAME>', | |
email = '<YOUR_EMAIL_ID>', | |
password = '<YOUR PASSWORD>') | |
try: | |
learn.fit(epochs, learning_rate, callbacks = my_cb) | |
except: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tensordash.torchdash import Torchdash | |
histories = Torchdash( | |
ModelName = '<YOUR_MODEL_NAME>', | |
email = '<YOUR_EMAIL_ID>', | |
password = '<YOUR PASSWORD>') | |
try: | |
for epoch in range(epochs): | |
losses = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tensordash.tensordash import Tensordash | |
histories = Tensordash( | |
ModelName = '<YOUR_MODEL_NAME>', | |
email = '<YOUR_EMAIL_ID>', | |
password = '<YOUR PASSWORD>') | |
try: | |
model.fit( | |
X_train, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
def sample(x, y, z): | |
return tf.reduce_sum(x + y * z) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
EMOTIONS = ["angry", "disgust", "scared", "happy", "sad", "surprised", "neutral"] # Emotions corresponding to the output | |
data = json.dumps({"signature_name": "serving_default", "instances": img.tolist()}) # making the input in the format required for serving | |
headers = {"content-type": "application/json"} # specifying that the input will be in json format | |
json_response = requests.post('http://localhost:8501/v1/models/emotion_model:predict', data=data, headers=headers) # post request to the served model | |
predictions = json.loads(json_response.text)['predictions'] # getting the predictions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img = cv2.imread('img.jpg') # reading the image | |
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) # converting the image to grayscale | |
img = cv2.resize(img, (48, 48)) # resizing the image | |
img = img/255 # normalizing the image | |
img = np.reshape(img, [-1, 48, 48, 1]) # reshaping the image to be suitable for serving |
NewerOlder