Spaces:
Runtime error
Runtime error
Commit
·
1527861
1
Parent(s):
3006f1e
updated njobs
Browse files- biomap/helper.py +3 -1
biomap/helper.py
CHANGED
@@ -51,7 +51,9 @@ def inference_on_location(model, longitude=2.98, latitude=48.81, start_date=2020
|
|
51 |
|
52 |
dates = [d.strftime("%Y-%m-%d") for d in dates]
|
53 |
|
54 |
-
|
|
|
|
|
55 |
# all_image = [cv2.imread("output/img.png") for i in range(len(dates))]
|
56 |
outputs = inference(np.array(all_image), model)
|
57 |
|
|
|
51 |
|
52 |
dates = [d.strftime("%Y-%m-%d") for d in dates]
|
53 |
|
54 |
+
n_jobs = min([12, len(dates)])
|
55 |
+
|
56 |
+
all_image = Parallel(n_jobs=n_jobs, prefer="threads")(delayed(get_image)(location, d1,d2) for d1, d2 in zip(dates[:-1],dates[1:]))
|
57 |
# all_image = [cv2.imread("output/img.png") for i in range(len(dates))]
|
58 |
outputs = inference(np.array(all_image), model)
|
59 |
|