Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
vrym2 committed Jun 1, 2023
1 parent 45b68a2 commit 0e8ef7d
Show file tree
Hide file tree
Showing 8 changed files with 250 additions and 19 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# YOLO-Airbus Oil tank detection

(Kaggle Notebook)[https://www.kaggle.com/code/jeffaudi/oil-storage-detection-on-airbus-imagery-with-yolox/notebook]
[Kaggle Notebook](https://www.kaggle.com/code/jeffaudi/oil-storage-detection-on-airbus-imagery-with-yolox/notebook)

### Installation - Requirements

Expand All @@ -9,12 +9,16 @@ Note: Both CUDA-10.1 and CUDA-10.2 should be added to `/usr/local/`, and add bel
export LD_LIBRARY_PATH=/usr/local/cuda-10.2/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
```

Make sure to run `environment.yml` to install all necessary packages, and the (YOLOX detection)[https://github.com/Megvii-BaseDetection/YOLOX] is adapted from the given link, make sure to clone the repo and install it as editable.
Make sure to run `environment.yml` to install all necessary packages, and the [YOLOX detection](https://github.com/Megvii-BaseDetection/YOLOX) is adapted from the given link, make sure to clone the repo and install it as editable.

and

Download `https://github.com/Megvii-BaseDetection/YOLOX/releases/download/0.1.1rc0/yolox_s.pth`

### Configuration

Make sure to run the coco and configuration files as explained in the instructions, especially adding the "oil" in the `COCO` class pre-defined coco classes
Make sure to run the coco and configuration files as explained in the instructions, especially adding the "oil" in the `COCO` class pre-defined coco classes

## Instructions of reproducing

```splits.py--->tiles.py--->oil_coco.py--->annots.py```
2 changes: 1 addition & 1 deletion data/splits/test_annots.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/splits/train_annots.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion data/splits/valid_annots.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/cfg/splits.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def split(self)-> None:
test_ids = np.loadtxt(os.path.join(self.data_dir,'test.txt'), dtype=str)

if __name__ == "__main__":
airbus_dataset_path = '/home/vardh/apps/tmp/airbus/'
HOME_DIR = os.path.expanduser('~')
airbus_dataset_path = os.path.join(HOME_DIR,'apps/tmp/airbus/')
data_dir = 'data/splits'
clean_pd= clean(airbus_dataset_path)
clean_pd.annots_pd()
Expand Down
4 changes: 3 additions & 1 deletion src/coco/oil_coco.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,7 @@ def add_oil_to_coco(yolox_install_path:str = None):
f.write(pipeline)

if __name__ == "__main__":
yolox_install_path = '/home/vardh/apps/YOLO/'
HOME_DIR = os.path.expanduser('~')

yolox_install_path = os.path.join(HOME_DIR, 'apps/tmp')
add_oil_to_coco(yolox_install_path)
9 changes: 5 additions & 4 deletions src/coco/tiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
config.fileConfig('logger.ini')
logger = logging.getLogger(__name__)

# Create 640 x 640 tiles with 64 pix overlap in /kaggle/working
TILE_WIDTH = 640
TILE_HEIGHT = 640
TILE_OVERLAP = 64
# Create 512 x 512 tiles with 0 pix overlap
TILE_WIDTH = 512
TILE_HEIGHT = 512
TILE_OVERLAP = 12
_overwriteFiles = True

ann_nb = 0
Expand Down Expand Up @@ -93,3 +93,4 @@ def tiling(self)-> None:
data = tiling_data(image_id_list, large_image_folder, destination_data_path)
data.tiling()
logger.info("Tiling finished!")

237 changes: 230 additions & 7 deletions src/visual/display.ipynb

Large diffs are not rendered by default.

0 comments on commit 0e8ef7d

Please sign in to comment.