示例#1
0
 def test_load_repository_valid_input(self):
     loader = DataLoader.DataLoader()
     repository_test = loader.db.query(Repository).first()
     repository = loader.load_repository(repository_test.id)
     assert repository == repository_test
示例#2
0
import os
import tensorflow as tf
from context import Yolov3
from context import yolo_anchors, yolo_anchor_masks, DataLoader


physical_devices = tf.config.experimental.list_physical_devices('GPU')
for physical_device in physical_devices:
    tf.config.experimental.set_memory_growth(physical_device, True)


image_size = 416
tfrecord_file = os.path.abspath('data/processed/coco2017_train.tfrecord')
dataset = DataLoader(yolo_anchors, yolo_anchor_masks,
                  batch_size=4, training=True).from_files(tfrecord_file)
model = Yolov3(image_size, channels=3, anchors=yolo_anchors,
               masks=yolo_anchor_masks, training=False)

for batch in dataset.take(1):
    pass
pred = model(batch[0])
print(pred)
示例#3
0
 def test_store_solidity_code_valid_code(self):
     loader = DataLoader.DataLoader()
     code = loader.db.query(Code).first()
     assert loader.store_solidity_code(code) is None
示例#4
0
 def test_load_repository_no_input(self):
     loader = DataLoader.DataLoader()
     assert loader.load_repository(None) is None
示例#5
0
 def test_store_solidity_code_no_input(self):
     loader = DataLoader.DataLoader()
     code = None
     assert loader.store_solidity_code(code) is None
示例#6
0
 def test_load_owner_not_found(self):
     loader = DataLoader.DataLoader()
     owner_id = 0
     assert loader.load_owner(owner_id) is None
示例#7
0
 def test_load_owner_valid_input(self):
     loader = DataLoader.DataLoader()
     owner_test = loader.db.query(Owner).first()
     owner = loader.load_owner(owner_test.id)
     assert owner == owner_test
示例#8
0
 def test_load_owner_no_input(self):
     loader = DataLoader.DataLoader()
     assert loader.load_owner(None) is None
示例#9
0
 def test_load_repository_not_found(self):
     loader = DataLoader.DataLoader()
     repository_id = 0
     assert loader.load_repository(repository_id) is None