Spaces:
Running
Running
cleanup code
Browse files
app.py
CHANGED
@@ -32,16 +32,12 @@ learn.loss_func = BCEWithLogitsLossFlat(thresh=0.4)
|
|
32 |
def predict(image, vtt):
|
33 |
vtt = base64.b64decode(vtt.replace("data:text/vtt;base64,", ""))
|
34 |
sprite = PILImage.create(image)
|
35 |
-
offsets = []
|
36 |
-
images = []
|
37 |
-
tensors = []
|
38 |
|
39 |
pre_process_data = []
|
40 |
for left, top, right, bottom in getVTToffsets(vtt):
|
41 |
cut_frame = sprite.crop((left, top, left + right, top + bottom))
|
42 |
image = n2.preprocess_image(cut_frame, n2.Preprocessing.YAHOO)
|
43 |
pre_process_data.append((np.expand_dims(image, axis=0), cut_frame, (left, top, right, bottom)))
|
44 |
-
|
45 |
|
46 |
offsets = []
|
47 |
images = []
|
|
|
32 |
def predict(image, vtt):
|
33 |
vtt = base64.b64decode(vtt.replace("data:text/vtt;base64,", ""))
|
34 |
sprite = PILImage.create(image)
|
|
|
|
|
|
|
35 |
|
36 |
pre_process_data = []
|
37 |
for left, top, right, bottom in getVTToffsets(vtt):
|
38 |
cut_frame = sprite.crop((left, top, left + right, top + bottom))
|
39 |
image = n2.preprocess_image(cut_frame, n2.Preprocessing.YAHOO)
|
40 |
pre_process_data.append((np.expand_dims(image, axis=0), cut_frame, (left, top, right, bottom)))
|
|
|
41 |
|
42 |
offsets = []
|
43 |
images = []
|