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
# This code works for: | |
# 1. Single image | |
# 2. List of images | |
# 3. An archive with images | |
# 4. List of archives | |
# 5. Mix of everything above | |
# Defined by list of: | |
# 1. Public URIs |
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 valohai | |
def main(old_config): | |
pipeline = valohai.Pipeline(name="train-superbai", config=old_config) | |
# Define nodes | |
convert = papi.execution("convert-superbai") | |
weights = papi.execution("weights") | |
train = papi.execution("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 numpy as np | |
from yolov3_tf2.models import YoloV3 | |
from yolov3_tf2.utils import load_darknet_weights | |
import tensorflow as tf | |
import valohai | |
params = { | |
"weights_num_classes": 80, | |
} |
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 os | |
from PIL import Image | |
import valohai | |
parameters = { | |
"width": 640, | |
"height": 480, | |
} | |
inputs = { | |
"images": [ |
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 glob | |
import os | |
import argparse | |
import json | |
import shutil | |
import tempfile | |
import zipfile | |
from PIL import Image | |
parser = argparse.ArgumentParser() |
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 enums import * | |
import random | |
import tensorflow as tf | |
import numpy as np | |
class DeepGambler: | |
def __init__(self, learning_rate=0.5, discount=0.95, exploration_rate=1.0, iterations=10000): | |
self.learning_rate = learning_rate | |
self.discount = discount # How much we appreciate future reward over current |
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 enums import * | |
import random | |
import tensorflow as tf | |
import numpy as np | |
class DeepGambler: | |
def __init__(self, learning_rate=0.1, discount=0.95, exploration_rate=1.0, iterations=10000): | |
self.learning_rate = learning_rate | |
self.discount = discount # How much we appreciate future reward over current | |
self.exploration_rate = 1.0 # Initial exploration rate |
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 enums import * | |
import random | |
import tensorflow as tf | |
import numpy as np | |
class DeepGambler: | |
def __init__(self, learning_rate=0.1, discount=0.95, exploration_rate=1.0, iterations=10000): | |
self.learning_rate = learning_rate | |
self.discount = discount # How much we appreciate future reward over current | |
self.exploration_rate = 1.0 # Initial exploration rate |