Skip to content

Instantly share code, notes, and snippets.

View devonartis's full-sized avatar
🎯
Focusing

T. Devon Artis devonartis

🎯
Focusing
View GitHub Profile
@devonartis
devonartis / verfiy,py
Created November 9, 2024 00:39
Verify GPU is being used on silicone mac
from config import PATHS, MODEL_PATH, PREDICTIONS_CSV, ADVERSARIAL_PREDICTIONS_CSV
import sys
import tensorflow as tf
import cv2
import numpy as np
import pandas as pd
from tqdm import tqdm
def verify_setup():
"""
# Installation Guide
## System Requirements
### Hardware
- Apple Silicon Mac (M1/M2/M3)
- Minimum 16GB RAM recommended
- SSD storage recommended
@devonartis
devonartis / Train.py
Created November 1, 2024 03:55
Hate Content Detection Model Training Script This script automates the process of training a hate content detection model using TensorFlow and KMeans clustering. It includes several key components: Device Setup: Checks available GPUs for optimized processing. Data Processing: Loads and preprocesses image data from specified training and test fol…
"""
Training script for hate content detection model
"""
import pandas as pd
import tensorflow as tf
from utils import ImageProcessor, SimpleMetalKMeans
def train():
"""Main training function"""
@devonartis
devonartis / Lottery2.sol
Last active August 7, 2021 22:36
Learning Solidity Contracts
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract Lottery {
address public manager;
address[] public players;
@devonartis
devonartis / ChainlinkSample.sol
Created June 17, 2021 01:12
Chainlink Sample
pragma solidity ^0.6.7;
import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol";
contract PriceConsumerV3 {
AggregatorV3Interface internal priceFeed;
/**
@devonartis
devonartis / metadata.json
Created June 7, 2021 02:27
Simple escrow
{"valueParameterDescriptions":[["Price","Amount of Lovelace to be paid by the *Buyer* for the item."]],"slotParameterDescriptions":[["Buyer's deposit timeout","Deadline by which the *Buyer* must deposit the selling *Price* in the contract."],["Buyer's dispute timeout","Deadline by which, if the *Buyer* has not opened a dispute, the *Seller* will be paid."],["Seller's response timeout","Deadline by which, if the *Seller* has not responded to the dispute, the *Buyer* will be refunded."],["Timeout for arbitrage","Deadline by which, if the *Arbiter* has not resolved the dispute, the *Buyer* will be refunded."]],"roleDescriptions":[["Arbiter","The party that will choose who gets the money in the event of a disagreement between the *Buyer* and the *Seller* about the outcome."],["Buyer","The party that wants to buy the item. Payment is made to the *Seller* if they acknowledge receiving the item."],["Seller","The party that wants to sell the item. They receive the payment if the exchange is uneventful."]],"contractTy
@devonartis
devonartis / metadata.json
Created May 18, 2021 00:46
Escrow with collateral
{"valueParameterDescriptions":[["Collateral amount","The amount of Lovelace to be deposited by both parties at the start of the contract to serve as an incentive for collaboration."],["Price","The amount of Lovelace to be paid by the *Buyer* as part of the exchange."]],"slotParameterDescriptions":[["Collateral deposit by seller timeout","The deadline by which the *Seller* must deposit the *Collateral amount* in the contract."],["Deposit of collateral by buyer timeout","The deadline by which the *Buyer* must deposit the *Collateral amount* in the contract."],["Deposit of price by buyer timeout","The deadline by which the *Buyer* must deposit the *Price* in the contract."],["Dispute by buyer timeout","The deadline by which, if the *Buyer* has not opened a dispute, the *Seller* will be paid."],["Seller's response timeout","The deadline by which, if the *Seller* has not responded to the dispute, the *Buyer* will be refunded."]],"roleDescriptions":[["Buyer","The party that pays for the item on sale."],["Seller","T
@devonartis
devonartis / metadata.json
Created May 18, 2021 00:46
Simple escrow
{"valueParameterDescriptions":[["Price","Amount of Lovelace to be paid by the *Buyer* for the item."]],"slotParameterDescriptions":[["Buyer's deposit timeout","Deadline by which the *Buyer* must deposit the selling *Price* in the contract."],["Buyer's dispute timeout","Deadline by which, if the *Buyer* has not opened a dispute, the *Seller* will be paid."],["Seller's response timeout","Deadline by which, if the *Seller* has not responded to the dispute, the *Buyer* will be refunded."],["Timeout for arbitrage","Deadline by which, if the *Arbiter* has not resolved the dispute, the *Buyer* will be refunded."]],"roleDescriptions":[["Arbiter","The party that will choose who gets the money in the event of a disagreement between the *Buyer* and the *Seller* about the outcome."],["Buyer","The party that wants to buy the item. Payment is made to the *Seller* if they acknowledge receiving the item."],["Seller","The party that wants to sell the item. They receive the payment if the exchange is uneventful."]],"contractTy
@devonartis
devonartis / metadata.json
Created May 17, 2021 23:19
Escrow with collateral
{"valueParameterDescriptions":[["Collateral amount","The amount of Lovelace to be deposited by both parties at the start of the contract to serve as an incentive for collaboration."],["Price","The amount of Lovelace to be paid by the *Buyer* as part of the exchange."]],"slotParameterDescriptions":[["Collateral deposit by seller timeout","The deadline by which the *Seller* must deposit the *Collateral amount* in the contract."],["Deposit of collateral by buyer timeout","The deadline by which the *Buyer* must deposit the *Collateral amount* in the contract."],["Deposit of price by buyer timeout","The deadline by which the *Buyer* must deposit the *Price* in the contract."],["Dispute by buyer timeout","The deadline by which, if the *Buyer* has not opened a dispute, the *Seller* will be paid."],["Seller's response timeout","The deadline by which, if the *Seller* has not responded to the dispute, the *Buyer* will be refunded."]],"roleDescriptions":[["Buyer","The party that pays for the item on sale."],["Seller","T
@devonartis
devonartis / Jenkinsfile
Created March 31, 2018 23:36
Set up a build pipeline with Jenkins and Amazon ECS
node {
def app
def commit_id
environment
{
ECRURL = 'http://xxxxx.dkr.ecr.us-east-1.amazonaws.com/node'
}