Update script.py
Browse files
script.py
CHANGED
|
@@ -17,4 +17,26 @@ print()
|
|
| 17 |
#model = load_model(MODEL_WEIGHTS_PATH) # the load_model function needs to be created by yourself
|
| 18 |
|
| 19 |
## run inference on test images to create submission.csv file
|
| 20 |
-
# run_inference(model, TEST_IMAGE_PATH) # the run_inference function needs to be created by yourself
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
#model = load_model(MODEL_WEIGHTS_PATH) # the load_model function needs to be created by yourself
|
| 18 |
|
| 19 |
## run inference on test images to create submission.csv file
|
| 20 |
+
# run_inference(model, TEST_IMAGE_PATH) # the run_inference function needs to be created by yourself
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
import csv
|
| 25 |
+
|
| 26 |
+
data = [
|
| 27 |
+
['file_name', 'bbox', 'category_id', 'split'],
|
| 28 |
+
['0000.jpg', '[[101.83, 148.06, 127.11, 111.12]]', '[1]', 'public'],
|
| 29 |
+
['0229.jpg', '[[230.0, 0.0, 65.33, 158.71]]', '[1]', 'public'],
|
| 30 |
+
['0232.jpg', '[[286.8, 110.04, 89.47, 125.36]]', '[2]', 'public'],
|
| 31 |
+
['0248.jpg', '[[59.59, 66.05, 211.59, 166.51]]', '[2]', 'public'],
|
| 32 |
+
['0586.jpg', '[[317.17, 177.91, 103.36, 78.59], [100.88, 104.64, 7.88, 9.75]]', '[1, 1]', 'public'],
|
| 33 |
+
['0765.jpg', '[[428.82, 145.57, 72.78, 77.05]]', '[3]', 'public']
|
| 34 |
+
]
|
| 35 |
+
|
| 36 |
+
filename = 'submission.csv'
|
| 37 |
+
|
| 38 |
+
with open(filename, 'w', newline='') as file:
|
| 39 |
+
writer = csv.writer(file)
|
| 40 |
+
writer.writerows(data)
|
| 41 |
+
|
| 42 |
+
print("Created submission.csv")
|