File size: 1,294 Bytes
184ecb1
27d7e84
 
8a7a6b9
184ecb1
 
27d7e84
184ecb1
 
27d7e84
184ecb1
 
27d7e84
184ecb1
f406318
 
 
 
a2bcb7c
 
f406318
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
## load necessary modules and libaries
import os


## Set Path to test images from folder (image shape is: 360x640x3)
TEST_IMAGE_PATH = "/tmp/data/test_images"

## Set Path to your model weights (stored in your model directory)
# MODEL_WEIGHTS_PATH = 'yolov5s.pt'

## load model
#model = load_model(MODEL_WEIGHTS_PATH) # the load_model function needs to be created by yourself

## run inference on test images to create submission.csv file
# run_inference(model, TEST_IMAGE_PATH) # the run_inference function needs to be created by yourself




### Code to create a sample submission.csv file ###
import csv

data = [
    ['file_name', 'bbox', 'category_id', 'split'],
    ['0000.jpg', '[[101.83, 148.06, 127.11, 111.12]]', '[1]', 'public'],
    ['0229.jpg', '[[230.0, 0.0, 65.33, 158.71]]', '[1]', 'public'],
    ['0232.jpg', '[[286.8, 110.04, 89.47, 125.36]]', '[2]', 'public'],
    ['0248.jpg', '[[59.59, 66.05, 211.59, 166.51]]', '[2]', 'public'],
    ['0586.jpg', '[[317.17, 177.91, 103.36, 78.59], [100.88, 104.64, 7.88, 9.75]]', '[1, 1]', 'public'],
    ['0765.jpg', '[[428.82, 145.57, 72.78, 77.05]]', '[3]', 'public']
]

filename = 'submission.csv'

with open(filename, 'w', newline='') as file:
    writer = csv.writer(file)
    writer.writerows(data)

print("Created submission.csv")