This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs"); | |
const path = require("path"); | |
const csv = require("fast-csv"); | |
let megaJSON = {}; //will contain a json of multiple jsons | |
let aws_s3_URL = "<s3-data-url>"; //s3 url | |
// csv header image_path,img-height,img-width,depth,left,top,width,height,label,label_id | |
// csv can have duplicate image_path for multiple ODs (left,top,width,height) in one image | |
// <"image-name-1"> | 200 | 300 | 3 | 45 | 100 | 56 | 200 | <"label-1"> | 0 | |
// <"image-name-1"> | 200 | 300 | 3 | 50 | 200 | 70 | 300 | <"label-2"> | 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import boto3 | |
# Get all the keys in S3 bucket | |
def get_matching_s3_keys(bucket, prefix='', suffix=''): | |
""" | |
Generate the keys in an S3 bucket. | |
Args: | |
bucket (str): Name of the S3 bucket. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import os | |
import json | |
import glob | |
import shutil | |
import logging | |
import boto3 | |
import pickle | |
import collections |