move yolo into examples/yolo
DELETE
examples/benchmark.py
-#!/usr/bin/env python3
-import numpy as np
-from tinygrad.tensor import Tensor
-import time
-
-# Tensor has max size of 0x4000 for now
-ba = Tensor(np.random.normal(size=(0x4000,)))
-for dev in ["CPU", "GPU", "ANE"]:
- if dev == "GPU":
- baa = ba.gpu()
- elif dev == "ANE":
- baa = ba.ane()
- else:
- baa = ba
- for i in range(3):
- st = time.time()
- boaa = baa.relu()
- et = time.time()
- if i == 2:
- print("%s can do at least %.2f MEGAReLUs/sec" % (dev, (np.prod(boaa.shape)/1e6)/(et-st)))
- # decently reliable
- assert(np.all(boaa.cpu().data >= 0))

DELETE
examples/use_ane.py
-#!/usr/bin/env python3
-import numpy as np
-from tinygrad.tensor import Tensor
-import time
-
-a = Tensor([-2,-1,0,1,2]).ane()
-print(a.cpu())
-b = a.relu()
-print(b.cpu())
-assert(np.all(b.cpu().data >= 0))

MODIFY
examples/vgg7.py
examples/vgg7.py
from PIL import Image
from tinygrad.tensor import Tensor
from tinygrad.optim import SGD
-import extra.waifu2x
-from extra.kinne import KinneDir
+import examples.yolo.waifu2x
+from examples.yolo.kinne import KinneDir
import sys
import os
import random

RENAME
extra/kinne.py
examples/yolo/kinne.py
RENAME
extra/waifu2x.py
examples/yolo/waifu2x.py
RENAME
examples/yolo_nn.py
examples/yolo/yolo_nn.py
MODIFY
examples/yolov3.py
examples/yolov3.py
@@ -10,7 +10,7 @@ import numpy as np
np.set_printoptions(suppress=True)
from tinygrad.tensor import Tensor
from extra.utils import fetch, get_parameters
-from yolo_nn import Upsample, EmptyLayer, DetectionLayer, LeakyReLU, MaxPool2d
+from examples.yolo.yolo_nn import Upsample, EmptyLayer, DetectionLayer, LeakyReLU, MaxPool2d
from tinygrad.nn import BatchNorm2D, Conv2d
import cv2

move yolo into examples/yolo