# CTE-DL4CV Assignment 1 — Data

来源：https://www.kaggle.com/competitions/dl4cv1/data

本地 Meta Kaggle 快照；不是本次实时页面。

# Dataset Description

<h3>This is a simple Object Localisation task to detect the bounding boxes around an object in an image</h3>
<p>Your task is to regress over the four parameters and output the 4 co-ordinates of the bounding box</p>
<b>The data of the images to be used for training and testing can be found here: </b> 
<href> https://drive.google.com/open?id=1FbyOAkNoR0mZsaj6wj93UYtmL5zOSCq9</href>

<b>The evaluation metric used for this assignment is DICE</b>
<p>Simply put, the Dice Coefficient is 2 * the Area of Overlap divided by the total number of pixels in both images the code for which is :</p>
<p> </p>
<b>def dice_coef(y_true, y_pred, smooth=1): </b>
<p> &nbsp intersection = K.sum(y_true * y_pred, axis=[1,2,3])  </p>
<p> &nbsp union = K.sum(y_true, axis=[1,2,3]) + K.sum(y_pred, axis=[1,2,3])  </p>
<p> &nbsp dice = K.mean((2. * intersection + smooth)/(union + smooth), axis=0)  </p>
<p> &nbsp return dice </p>

<p>Please note that you will need to convert your bounding boxes into a run-length encoding for submission</p>
<b> What is Run length encoding? </b>
<p> In order to reduce the submission file size, our metric uses run-length encoding on the pixel values. Instead of submitting an exhaustive list of indices for your segmentation, you will submit pairs of values that contain a start position and a run length. E.g. '1 3' implies starting at pixel 1 and running a total of 3 pixels (1,2,3).

The competition format requires a space delimited list of pairs. For example, '1 3 10 5' implies pixels 1,2,3,10,11,12,13,14 are to be included in the mask. The pixels are one-indexed and numbered from top to bottom, then left to right: 1 is pixel (1,1), 2 is pixel (2,1), etc. </p>

<b> The code for converting a dataframe with bounding box co-ordinates into Run-length encoding is present in the notebooks section. Please convert into the submission format before submitting. </b>






<h2>File descriptions</h2>
<ul>
<li><strong>train_final.csv</strong> - the training set</li>
<li><strong>testing_final3.csv</strong> - the test set</li>
<li><strong>sampleSubmission.csv</strong> - a sample submission file in the correct format</li>
</ul>
<h2>Data fields</h2>
<ul>
<li><strong>ids</strong> - Image names</li>
<li><strong>x1</strong> - Starting x co-ordinate of box</li>
<li><strong>x2</strong> - Ending x co-ordinate of box</li>
<li><strong>y2</strong> - Starting y co-ordinate of box</li>
<li><strong>y2</strong> - Ending y co-ordinate of box</li>
<li><strong>rle</strong> - Run length encoding of the bounding box</li>
</ul>