Giter Site home page Giter Site logo

pedropro / taco Goto Github PK

View Code? Open in Web Editor NEW
569.0 25.0 195.0 100.34 MB

🌮 Trash Annotations in Context Dataset Toolkit

Home Page: http://tacodataset.org

License: MIT License

Jupyter Notebook 99.53% Python 0.47%
trash dataset mask-rcnn object-detection litter deep-learning garbage

taco's Introduction

TACO is a growing image dataset of waste in the wild. It contains images of litter taken under diverse environments: woods, roads and beaches. These images are manually labeled and segmented according to a hierarchical taxonomy to train and evaluate object detection algorithms. Currently, images are hosted on Flickr and we have a server that is collecting more images and annotations @ tacodataset.org


For convenience, annotations are provided in COCO format. Check the metadata here: http://cocodataset.org/#format-data

TACO is still relatively small, but it is growing. Stay tuned!

Publications

For more details check our paper: https://arxiv.org/abs/2003.06975

If you use this dataset and API in a publication, please cite us using:  

@article{taco2020,
    title={TACO: Trash Annotations in Context for Litter Detection},
    author={Pedro F Proença and Pedro Simões},
    journal={arXiv preprint arXiv:2003.06975},
    year={2020}
}

News

December 20, 2019 - Added more 785 images and 2642 litter segmentations.
November 20, 2019 - TACO is officially open for new annotations: http://tacodataset.org/annotate

Getting started

Requirements

To install the required python packages simply type

pip3 install -r requirements.txt

Additionaly, to use demo.pynb, you will also need coco python api. You can get this using

pip3 install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI

Download

To download the dataset images simply issue

python3 download.py

Alternatively, download from DOI

Our API contains a jupyter notebook demo.pynb to inspect the dataset and visualize annotations.

Unlabeled data

A list of URLs for both unlabeled and labeled images is now also provided in data/all_image_urls.csv. Each image contains one URL for each original image (second column) and one URL for a VGA-resized version (first column) for images hosted by Flickr. If you decide to annotate these images using other tools, please make them public and contact us so we can keep track.

Unofficial data

Annotations submitted via our website are added weekly to data/annotations_unofficial.json. These have not yet been been reviewed by us -- some may be inaccurate or have poor segmentations. You can use the same command to download the respective images:

python3 download.py --dataset_path ./data/annotations_unofficial.json

Trash Detection

The implementation of Mask R-CNN by Matterport is included in /detector with a few modifications. Requirements are the same. Before using this, the dataset needs to be split. You can either donwload our weights and splits or generate these from scratch using the split_dataset.py script to generate N random train, val, test subsets. For example, run this inside the directory detector:

python3 split_dataset.py --dataset_dir ../data

For further usage instructions, check detector/detector.py.

As you can see here, most of the original classes of TACO have very few annotations, therefore these must be either left out or merged together. Depending on the problem, detector/taco_config contains several class maps to target classes, which maintain the most dominant classes, e.g., Can, Bottles and Plastic bags. Feel free to make your own classes.

taco's People

Contributors

beardmix avatar pedropro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

taco's Issues

Good peoject!

This is an interesting project,but dataset is not enough,I want to join you!

Working configuration

Hi,

first of all thank you for the project. I tried to launch the script detector.py. After all the dependency was installed, I launched the script that return me the error: AttributeError: module 'tensorflow' has no attribute 'log'. The error is certainly due to the tensorflow version installed in my laptop. Referring to issue #17, Python 3.5, Keras 2.0.8, and Tensorflow 1.3.0 seems to work. But the question is: is there a newer working configuration?

Thank you in advance,
Lorenzo

'numpy.float64' error

I am trying to train instance segmentation model with mmdetection using dataset and I got this error
TypeError: 'numpy.float64' object cannot be interpreted as an integer

I want to segment with mmedetection (You can also find the mmdetection repo here. https://github.com/open-mmlab/mmdetection ) using the dataset in the link. https://github.com/pedropro/TACO

TACO dataset is a dataset in COCO format used for garbage detection. Classes in them ['Aluminium foil', 'Battery', 'Aluminium blister pack', 'Carded blister pack', 'Other plastic bottle', 'Clear plastic bottle', 'Glass bottle', 'Plastic bottle cap', 'Metal bottle cap', 'Broken glass', 'Food Can', 'Aerosol', 'Drink can', 'Toilet tube', 'Other carton', 'Egg carton', 'Drink carton', 'Corrugated carton', 'Meal carton', 'Pizza box', 'Paper cup', 'Disposable plastic cup', 'Foam cup', 'Glass cup', 'Other plastic cup', 'Food waste', 'Glass jar', 'Plastic lid', 'Metal lid', 'Other plastic', 'Magazine paper', 'Tissues', 'Wrapping paper', 'Normal paper', 'Paper bag', 'Plastified paper bag', 'Plastic film', 'Six pack rings', 'Garbage bag', 'Other plastic wrapper', 'Single-use carrier bag', 'Polypropylene bag', 'Crisp packet', 'Spread tub', 'Tupperware', 'Disposable food container', 'Foam food container', 'Other plastic container', 'Plastic glooves', 'Plastic utensils', 'Pop tab', 'Rope & strings', 'Scrap metal', 'Shoe', 'Squeezable tube', 'Plastic straw', 'Paper straw', 'Styrofoam piece', 'Unlabeled litter', 'Cigarette']

I obtained the data by following the instructions in the Getting started section in the TACO github repo. I separated the annotations.json file as test, train and valid with the help of https://pypi.org/project/echo1-coco-split/ link.

As you can see below, when I run it for the train after giving the path of the test, train and valid annotation files and images I have obtained to the config file in mmdetection for the train process, I get an error in the Evaluating section after the train part is finished.

2023-02-08 08:33:53,641 - mmdet - INFO - Epoch [11][10/50]	lr: 2.500e-03, eta: 0:11:59, time: 0.724, data_time: 0.240, memory: 3987, loss_rpn_cls: 0.0006, loss_rpn_bbox: 0.0054, loss_cls: 0.0373, acc: 98.8672, loss_bbox: 0.0857, loss_mask: 0.0723, loss: 0.2013
2023-02-08 08:33:58,535 - mmdet - INFO - Epoch [11][20/50]	lr: 2.500e-03, eta: 0:11:51, time: 0.488, data_time: 0.028, memory: 3987, loss_rpn_cls: 0.0008, loss_rpn_bbox: 0.0064, loss_cls: 0.0309, acc: 99.1016, loss_bbox: 0.0847, loss_mask: 0.0703, loss: 0.1931
2023-02-08 08:34:03,679 - mmdet - INFO - Epoch [11][30/50]	lr: 2.500e-03, eta: 0:11:45, time: 0.514, data_time: 0.034, memory: 3987, loss_rpn_cls: 0.0014, loss_rpn_bbox: 0.0096, loss_cls: 0.0424, acc: 98.4766, loss_bbox: 0.0927, loss_mask: 0.0798, loss: 0.2260
2023-02-08 08:34:09,220 - mmdet - INFO - Epoch [11][40/50]	lr: 2.500e-03, eta: 0:11:39, time: 0.553, data_time: 0.063, memory: 3987, loss_rpn_cls: 0.0009, loss_rpn_bbox: 0.0089, loss_cls: 0.0336, acc: 98.9746, loss_bbox: 0.0824, loss_mask: 0.0768, loss: 0.2026
2023-02-08 08:34:14,489 - mmdet - INFO - Epoch [11][50/50]	lr: 2.500e-03, eta: 0:11:33, time: 0.529, data_time: 0.032, memory: 3987, loss_rpn_cls: 0.0005, loss_rpn_bbox: 0.0079, loss_cls: 0.0359, acc: 98.7793, loss_bbox: 0.0876, loss_mask: 0.0947, loss: 0.2265
2023-02-08 08:34:21,829 - mmdet - INFO - Epoch [12][10/50]	lr: 2.500e-03, eta: 0:11:31, time: 0.708, data_time: 0.232, memory: 3987, loss_rpn_cls: 0.0005, loss_rpn_bbox: 0.0037, loss_cls: 0.0285, acc: 98.9844, loss_bbox: 0.0640, loss_mask: 0.0747, loss: 0.1714
2023-02-08 08:34:26,653 - mmdet - INFO - Epoch [12][20/50]	lr: 2.500e-03, eta: 0:11:24, time: 0.483, data_time: 0.028, memory: 3987, loss_rpn_cls: 0.0005, loss_rpn_bbox: 0.0058, loss_cls: 0.0302, acc: 98.8965, loss_bbox: 0.0657, loss_mask: 0.0694, loss: 0.1716
2023-02-08 08:34:31,685 - mmdet - INFO - Epoch [12][30/50]	lr: 2.500e-03, eta: 0:11:17, time: 0.500, data_time: 0.028, memory: 3987, loss_rpn_cls: 0.0015, loss_rpn_bbox: 0.0101, loss_cls: 0.0366, acc: 98.9844, loss_bbox: 0.1061, loss_mask: 0.0828, loss: 0.2371
2023-02-08 08:34:36,939 - mmdet - INFO - Epoch [12][40/50]	lr: 2.500e-03, eta: 0:11:11, time: 0.525, data_time: 0.031, memory: 3987, loss_rpn_cls: 0.0015, loss_rpn_bbox: 0.0063, loss_cls: 0.0334, acc: 98.8477, loss_bbox: 0.0706, loss_mask: 0.0762, loss: 0.1880
2023-02-08 08:34:42,106 - mmdet - INFO - Epoch [12][50/50]	lr: 2.500e-03, eta: 0:11:04, time: 0.520, data_time: 0.032, memory: 3987, loss_rpn_cls: 0.0011, loss_rpn_bbox: 0.0073, loss_cls: 0.0400, acc: 98.7305, loss_bbox: 0.0884, loss_mask: 0.0778, loss: 0.2147
2023-02-08 08:34:42,154 - mmdet - INFO - Saving checkpoint at 12 epochs
[>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>] 3/3, 4.3 task/s, elapsed: 1s, ETA:     0s
2023-02-08 08:34:46,374 - mmdet - INFO - Evaluating bbox...
Loading and preparing results...
DONE (t=0.00s)
creating index...
index created!

'---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
/tmp/ipykernel_26640/1144535353.py in
17 # Create work_dir
18 mmcv.mkdir_or_exist(osp.abspath(cfg.work_dir))
---> 19 train_detector(model, datasets, cfg, distributed=False, validate=True)

~/violations-tracing-project/mmdetection/mmdet/apis/train.py in train_detector(model, dataset, cfg, distributed, validate, timestamp, meta)
244 elif cfg.load_from:
245 runner.load_checkpoint(cfg.load_from)
--> 246 runner.run(data_loaders, cfg.workflow)

/opt/conda/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py in run(self, data_loaders, workflow, max_epochs, **kwargs)
134 if mode == 'train' and self.epoch >= self._max_epochs:
135 break
--> 136 epoch_runner(data_loaders[i], **kwargs)
137
138 time.sleep(1) # wait for some hooks like loggers to finish

/opt/conda/lib/python3.7/site-packages/mmcv/runner/epoch_based_runner.py in train(self, data_loader, **kwargs)
56 self._iter += 1
57
---> 58 self.call_hook('after_train_epoch')
59 self._epoch += 1
60

/opt/conda/lib/python3.7/site-packages/mmcv/runner/base_runner.py in call_hook(self, fn_name)
315 """
316 for hook in self._hooks:
--> 317 getattr(hook, fn_name)(self)
318
319 def get_hook_info(self) -> str:

/opt/conda/lib/python3.7/site-packages/mmcv/runner/hooks/evaluation.py in after_train_epoch(self, runner)
269 """Called after every training epoch to evaluate the results."""
270 if self.by_epoch and self._should_evaluate(runner):
--> 271 self._do_evaluate(runner)
272
273 def _do_evaluate(self, runner):

~/violations-tracing-project/mmdetection/mmdet/core/evaluation/eval_hooks.py in _do_evaluate(self, runner)
61 self.latest_results = results
62 runner.log_buffer.output['eval_iter_num'] = len(self.dataloader)
---> 63 key_score = self.evaluate(runner, results)
64 # the key_score may be None so it needs to skip the action to save
65 # the best checkpoint

/opt/conda/lib/python3.7/site-packages/mmcv/runner/hooks/evaluation.py in evaluate(self, runner, results)
366 """
367 eval_res = self.dataloader.dataset.evaluate(
--> 368 results, logger=runner.logger, **self.eval_kwargs)
369
370 for name, val in eval_res.items():

~/violations-tracing-project/mmdetection/mmdet/datasets/coco.py in evaluate(self, results, metric, logger, jsonfile_prefix, classwise, proposal_nums, iou_thrs, metric_items)
643 metrics, logger, classwise,
644 proposal_nums, iou_thrs,
--> 645 metric_items)
646
647 if tmp_dir is not None:

~/violations-tracing-project/mmdetection/mmdet/datasets/coco.py in evaluate_det_segm(self, results, result_files, coco_gt, metrics, logger, classwise, proposal_nums, iou_thrs, metric_items)
481 break
482
--> 483 cocoEval = COCOeval(coco_gt, coco_det, iou_type)
484 cocoEval.params.catIds = self.cat_ids
485 cocoEval.params.imgIds = self.img_ids

/opt/conda/lib/python3.7/site-packages/pycocotools/cocoeval.py in init(self, cocoGt, cocoDt, iouType)
74 self._gts = defaultdict(list) # gt for evaluation
75 self._dts = defaultdict(list) # dt for evaluation
---> 76 self.params = Params(iouType=iouType) # parameters
77 self._paramsEval = {} # parameters for evaluation
78 self.stats = [] # result summarization

/opt/conda/lib/python3.7/site-packages/pycocotools/cocoeval.py in init(self, iouType)
525 def init(self, iouType='segm'):
526 if iouType == 'segm' or iouType == 'bbox':
--> 527 self.setDetParams()
528 elif iouType == 'keypoints':
529 self.setKpParams()

/opt/conda/lib/python3.7/site-packages/pycocotools/cocoeval.py in setDetParams(self)
505 self.catIds = []
506 # np.arange causes trouble. the data point on arange is slightly larger than the true value
--> 507 self.iouThrs = np.linspace(.5, 0.95, np.round((0.95 - .5) / .05) + 1, endpoint=True)
508 self.recThrs = np.linspace(.0, 1.00, np.round((1.00 - .0) / .01) + 1, endpoint=True)
509 self.maxDets = [1, 10, 100]

<array_function internals> in linspace(*args, **kwargs)

/opt/conda/lib/python3.7/site-packages/numpy/core/function_base.py in linspace(start, stop, num, endpoint, retstep, dtype, axis)
118
119 """
--> 120 num = operator.index(num)
121 if num < 0:
122 raise ValueError("Number of samples, %s, must be non-negative." % num)

TypeError: 'numpy.float64' object cannot be interpreted as an integer`

I converted the values in the segmentation part of the annotation files from float to integer, and I did the same for the values in the box part. but the problem was not fixed.
on this line where train for mmdetection is started train_detector(model, datasets, cfg, distributed=False, validate=True)
If validate=False, the train process is finished without an error, but since there is no validation, I cannot determine my accuracy (such as precision, recall). Also, although it was not the best result, it was not a correct train because it saved the last log. If I solve the float problem in the validation part here, I will continue my train process in a healthy way.

Host has failed to respond

On running python download.py ,
I get the error on 226/1500 :

(taco) D:\Eeshaan\itsp\TACO\TACO>python download.py
Note. If for any reason the connection is broken. Just call me again and I will start where I left.
Traceback (most recent call last):......] - 226/1500
  File "D:\Anaconda\lib\site-packages\urllib3\connection.py", line 157, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "D:\Anaconda\lib\site-packages\urllib3\util\connection.py", line 84, in create_connection
    raise err
  File "D:\Anaconda\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection
    sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Anaconda\lib\site-packages\urllib3\connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "D:\Anaconda\lib\site-packages\urllib3\connectionpool.py", line 376, in _make_request
    self._validate_conn(conn)
  File "D:\Anaconda\lib\site-packages\urllib3\connectionpool.py", line 994, in _validate_conn
    conn.connect()
  File "D:\Anaconda\lib\site-packages\urllib3\connection.py", line 300, in connect
    conn = self._new_conn()
  File "D:\Anaconda\lib\site-packages\urllib3\connection.py", line 169, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x00000207ADE0EC08>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Anaconda\lib\site-packages\requests\adapters.py", line 449, in send
    timeout=timeout
  File "D:\Anaconda\lib\site-packages\urllib3\connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "D:\Anaconda\lib\site-packages\urllib3\util\retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='olm-s3.s3.eu-west-1.amazonaws.com', port=443): Max retries exceeded with url: /1048/NGJChI8EE2bifY13rXYHC8OVoIZ6PpdVpZvNRYBq.jpeg (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000207ADE0EC08>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "download.py", line 44, in <module>
    response = requests.get(url_original)
  File "D:\Anaconda\lib\site-packages\requests\api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "D:\Anaconda\lib\site-packages\requests\api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "D:\Anaconda\lib\site-packages\requests\sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "D:\Anaconda\lib\site-packages\requests\sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "D:\Anaconda\lib\site-packages\requests\adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='olm-s3.s3.eu-west-1.amazonaws.com', port=443): Max retries exceeded with url: /1048/NGJChI8EE2bifY13rXYHC8OVoIZ6PpdVpZvNRYBq.jpeg (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x00000207ADE0EC08>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))

Annotations seem wrong

If you look at this image
{"id": 561, "width": 2448, "height": 3264, "file_name": "batch_6/000031.JPG", "license": null, "flickr_url": "https://farm66.staticflickr.com/65535/47066796004_01600acd87_o.png", "coco_url": null, "date_captured": null, "flickr_640_url": "https://farm66.staticflickr.com/65535/47066796004_8f22c4f60c_z.jpg"}
which has an annotation
{"id": 1625, "image_id": 561, "category_id": 29, "segmentation": [[1258.0, 1598.0, 1266.0, 1599.0, 1278.0, 1607.0, 1284.0, 1623.0, 1285.0, 1638.0, 1313.0, 1641.0, 1322.0, 1624.0, 1330.0, 1587.0, 1341.0, 1571.0, 1354.0, 1551.0, 1335.0, 1537.0, 1315.0, 1531.0, 1289.0, 1529.0, 1269.0, 1536.0, 1274.0, 1555.0, 1271.0, 1570.0, 1262.0, 1590.0, 1258.0, 1598.0]], "area": 6447.0, "bbox": [1258.0, 1623.0, 96.0, 112.0], "iscrowd": 0}

If I draw this on the image with left top corner (0,0), I get the following image.
Screenshot 2019-12-11 at 15 15 46

I see this across all images. It seems to be mirrored across the middle. If I do y=image_height - object_y - object-height, I get the correct y coordinate.

Error when loading split released models for inference on custom data

I get the following error wen I try to use the pretrained detectors found in releases (https://github.com/pedropro/TACO/releases/tag/1.0).

  File /TACO/detector/model.py", line 2235, in load_weights
     topology.load_weights_from_hdf5_group_by_name(f, layers)
   File "/miniconda3/envs/taco/lib/python3.6/site-packages/keras/engine/topology.py", line 3479, in load_weights_from_hdf5_group_by_name
     K.batch_set_value(weight_value_tuples)
   File "miniconda3/envs/taco/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2372, in batch_set_value
     assign_op = x.assign(assign_placeholder)
   File "miniconda3/envs/taco/lib/python3.6/site-packages/tensorflow/python/ops/variables.py", line 1762, in assign
     name=name)
   File "miniconda3/envs/taco/lib/python3.6/site-packages/tensorflow/python/ops/state_ops.py", line 223, in assign
     validate_shape=validate_shape)
   File "miniconda3/envs/taco/lib/python3.6/site-packages/tensorflow/python/ops/gen_state_ops.py", line 64, in assign
     use_locking=use_locking, name=name)
   File "miniconda3/envs/taco/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 788, in _apply_op_helper
     op_def=op_def)
   File "miniconda3/envs/taco/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 507, in new_func
     return func(*args, **kwargs)
   File "miniconda3/envs/taco/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3300, in create_op
     op_def=op_def)
   File "miniconda3/envs/taco/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1823, in __init__
     control_input_ops)
   File "miniconda3/envs/taco/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 1662, in _create_c_op
     raise ValueError(str(e))
 ValueError: Dimension 1 in both shapes must be equal, but are 256 and 44. Shapes are [1024,256] and [1024,44]. for 'Assign_376' (op: 'Assign') with input shapes: [1024,256], [1024,44].

I use keras 2.1.6 and tensorflow 1.13.1
My Config look like this:

Configurations:
BACKBONE                       resnet50
BACKBONE_STRIDES               [4, 8, 16, 32, 64]
BATCH_SIZE                     1
BBOX_STD_DEV                   [0.1 0.1 0.2 0.2]
DETECTION_CLASSLESS_NMS_THRESHOLD 0.9
DETECTION_MAX_INSTANCES        100
DETECTION_MIN_CONFIDENCE       0
DETECTION_NMS_THRESHOLD        0.3
DETECTION_SCORE_RATIO          True
GPU_COUNT                      1
GRADIENT_CLIP_NORM             5.0
IMAGES_PER_GPU                 1
IMAGE_MAX_DIM                  1024
IMAGE_META_SIZE                76
IMAGE_MIN_DIM                  800
IMAGE_MIN_SCALE                0
IMAGE_RESIZE_MODE              square
IMAGE_SHAPE                    [1024 1024    3]
LEARNING_MOMENTUM              0.9
LEARNING_RATE                  0.001
LOSS_WEIGHTS                   {'rpn_class_loss': 1.0, 'rpn_bbox_loss': 1.0, 'mrcnn_class_loss': 1.0, 'mrcnn_bbox_loss': 1.0, 'mrcnn_mask_loss': 1.0}
MASK_POOL_SIZE                 14
MASK_SHAPE                     [28, 28]
MASK_SHARE                     False
MAX_GT_INSTANCES               100
MEAN_PIXEL                     [123.7 116.8 103.9]
MINI_MASK_SHAPE                (512, 512)
NAME                           taco
NUM_CLASSES                    64
OPTIMIZER                      SGD
POOL_SIZE                      7
POST_NMS_ROIS_INFERENCE        1000
POST_NMS_ROIS_TRAINING         2000
ROI_POSITIVE_RATIO             0.33
RPN_ANCHOR_RATIOS              [0.5, 1, 2]
RPN_ANCHOR_SCALES              (32, 64, 128, 256, 512)
RPN_ANCHOR_STRIDE              1
RPN_BBOX_STD_DEV               [0.1 0.1 0.2 0.2]
RPN_NMS_THRESHOLD              0.7
RPN_TRAIN_ANCHORS_PER_IMAGE    256
STEPS_PER_EPOCH                1000
TRAIN_BN                       False
TRAIN_ROIS_PER_IMAGE           200
USE_MINI_MASK                  False
USE_OBJECT_ZOOM                False
USE_RPN_ROIS                   True
VALIDATION_STEPS               50
WEIGHT_DECAY                   0.0001
ZOOM_IN_FREQ                   0.5

and I used --class_map=taco_config/map_10.csv for inference.

demo: ValueError: Value for `orient` not understood: 1

New seaborn versions do not support arg: orient='1'

plot_1 = sns.barplot(x="Number of annotations", y="Categories", data=df,
            label="Total", color="b", orient='1')

ValueError: Value for orient not understood: 1

TODO: Drop it

issue with coco evaulate

When i issued this command:
python detector.py --model coco --dataset ../data/ --round 0 --class_map taco_config/map_1.csv evaluate
got error as below traceback after index created in 150 images.
..............
Running COCO evaluation on 150 images.
Loading and preparing results...
DONE (t=0.02s)
creating index...
index created!
Traceback (most recent call last):
File "detector.py", line 373, in
evaluate_coco(model, dataset_test, taco, "segm", limit=0)
File "detector.py", line 187, in evaluate_coco
cocoEval = COCOeval(coco, coco_results, eval_type)
File "/home/farhat/.virtualenvs/taco/lib/python3.6/site-packages/pycocotools/cocoeval.py", line 76, in init
self.params = Params(iouType=iouType) # parameters
File "/home/farhat/.virtualenvs/taco/lib/python3.6/site-packages/pycocotools/cocoeval.py", line 527, in init
self.setDetParams()
File "/home/farhat/.virtualenvs/taco/lib/python3.6/site-packages/pycocotools/cocoeval.py", line 507, in setDetParams
self.iouThrs = np.linspace(.5, 0.95, np.round((0.95 - .5) / .05) + 1, endpoint=True)
File "<array_function internals>", line 6, in linspace
File "/home/farhat/.virtualenvs/taco/lib/python3.6/site-packages/numpy/core/function_base.py", line 113, in linspace
num = operator.index(num)
TypeError: 'numpy.float64' object cannot be interpreted as an integer
..............
any help is highly appreciated!

Some annotations ids are not unique

Hi,

I discovered that some annotations ids are not unique e.g. 309 and 4040 occur two times.
I consider... is there a race condition during parallel labeling?

Help getting a .hd5f file with model architecture and weights

Thank you for this repository! I am using the pre-trained weights downloaded here, and it looks like the .h5 file has only the weights and not the model architecture. Is there a way to extract the model architecture from the weights? I've tried the code below, but it just prints "None" for the model configuration. Is there a place I could find a generic config.json file for the Mask-RCNN architecture and somehow merge the weights with it?

from tensorflow import keras

import h5py
f = h5py.File('mask_rcnn_taco_0100.h5', 'r')
print(f.attrs.get('model_config'))

Partnership with Litterati

Hi Pedro,

I really like the project and the idea behind it!
I don't know if you know them, but there is a similar but not competitive project called "Litterati".
It's litter classification crowdsourcing.
https://www.litterati.org/
They have 4 million classified samples.

Maybe you could leverage the power of their dataset or use it as a pre-training of some sort.
I think that combining efforts will be essential here :D

Hope it helps,
Mathieu

A question about dataset

Hi, pedro!
I would like to know when will the dataset be updated next time ? I can not wait any more!

imgaug missing from requirements.txt

python3 -W ignore detector.py train --model=coco --dataset=../data --class_map=./taco_config/map_10.csv --round 0
Traceback (most recent call last):
  File "detector.py", line 46, in <module>
    from imgaug import augmenters as iaa
ModuleNotFoundError: No module named 'imgaug'

Fixed via pip install imgaug.

Testing Trained Weights

Currently trying to test the trained weights that were already provided, but getting an error.

I downloaded the taco_10_3.zip, placed the split data and .h5 in the mentioned directories.

Then ran this command:
python3 detector.py test --dataset=../data --model=./models/logs/mask_rcnn_taco_0100.h5 --round 3 --class_map=./taco_config/map_3.csv

This is the error:

Traceback (most recent call last): File "detector.py", line 283, in <module> model.load_weights(model_path, by_name=True) File "/Users/ellioteckholm/Documents/AI/Pre_trained_TACO/detector/model.py", line 2088, in load_weights topology.load_weights_from_hdf5_group_by_name(f, layers) File "/usr/local/lib/python3.7/site-packages/keras/engine/topology.py", line 3479, in load_weights_from_hdf5_group_by_name K.batch_set_value(weight_value_tuples) File "/usr/local/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py", line 2372, in batch_set_value assign_op = x.assign(assign_placeholder) File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/ops/variables.py", line 2067, in assign self._variable, value, use_locking=use_locking, name=name) File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/ops/state_ops.py", line 227, in assign validate_shape=validate_shape) File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/ops/gen_state_ops.py", line 66, in assign use_locking=use_locking, name=name) File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/framework/op_def_library.py", line 794, in _apply_op_helper op_def=op_def) File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/util/deprecation.py", line 507, in new_func return func(*args, **kwargs) File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 3357, in create_op attrs, op_def, compute_device) File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 3426, in _create_op_internal op_def=op_def) File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 1770, in __init__ control_input_ops) File "/usr/local/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py", line 1610, in _create_c_op raise ValueError(str(e)) ValueError: Dimension 1 in both shapes must be equal, but are 16 and 44. Shapes are [1024,16] and [1024,44]. for 'Assign_376' (op: 'Assign') with input shapes: [1024,16], [1024,44].

weights TACO_1

Is it possible to share the weights for the taco model which identifies trash, like described in your paper?
Thanks in advance!

There are no unlabeled images in data/all_image_urls.csv

Hi,

I have checked all the image URLs in the data/all_image_urls.csv file. They are either in unofficial or official labeled images, so there are no unlabeled images in this list. How can we get the unlabeled images?

Thank you.

demo: ValueError: Value for `orient` not understood: 1

New seaborn versions do not support arg: orient='1'

plot_1 = sns.barplot(x="Number of annotations", y="Categories", data=df,
            label="Total", color="b", orient='1')

ValueError: Value for orient not understood: 1

TODO: Drop it

Please provide also unlabelled data

Hi @pedropro
I'm working on semi-supervised and weakly-supervised learning for object detection and I found your dataset perfectly suits my new idea in methodology.
I tried your github repo and it turns out that download.py only downloads fully annotated images and no unlabelled attached or anyway to have them downloaded on my local.
You might already know semi-supervised learning also leverages the unlabelled images with the similar distribution (environment) so I really need them. I think this also opens a gate for machine-human cooperation when ML creates mid-quality annotations and humans need to double check and correct a little bit which boosts the annotation process.
Hope you can share it. Thank you very much.

i find the annotation's id is not unique

{
"id": 4040,
"image_id": 1281,
"category_id": 59,
"segmentation": [
[
156.0,
1460.0,
142.0,
1372.0,
170.0,
1362.0,
184.0,
1452.0,
172.0,
1462.0,
156.0,
1460.0
]
],
"area": 2710.0,
"bbox": [
142.0,
1362.0,
42.0,
100.0
],
"iscrowd": 0
},
{
"id": 4040,
"image_id": 1300,
"category_id": 58,
"segmentation": [
[
143,
1979,
187,
1980,
184,
2028,
158,
2028,
156,
2014,
145,
2009
]
],
"area": 1798.5,
"bbox": [
143.0,
1979.0,
44.0,
49.0
],
"iscrowd": 0
},

Difficulty loading the database.

How could I load the COCO dataset model in tensorflow?
I've been racking my brain for days and even today I haven't even managed to get close to loading this database into tensorflow. All the tutorials I see on the internet in the COCO format are divided into category folders. can anybody help me?

TypeError: Could not build a TypeSpec for KerasTensor(type_spec=TensorSpec(shape=(None, None, 4), dtype=tf.float32, name=None), name='tf.math.truediv/truediv:0'

When I try to run the detector I get this:

python3 -W ignore detector.py train --model=coco --dataset=../data --class_map=./taco_config/map_10.csv --round 0
Command:  train
Model:  coco
Dataset:  ../data
Logs:  /Users/hackeron/TACO/detector/models/logs
creating index...
index created!
Number of images used: 1200
creating index...
index created!
Number of images used: 150

Configurations:
BACKBONE                       resnet50
BACKBONE_STRIDES               [4, 8, 16, 32, 64]
BATCH_SIZE                     2
BBOX_STD_DEV                   [0.1 0.1 0.2 0.2]
DETECTION_CLASSLESS_NMS_THRESHOLD 0.9
DETECTION_MAX_INSTANCES        100
DETECTION_MIN_CONFIDENCE       0.7
DETECTION_NMS_THRESHOLD        0.3
DETECTION_SCORE_RATIO          True
GPU_COUNT                      1
GRADIENT_CLIP_NORM             5.0
IMAGES_PER_GPU                 2
IMAGE_MAX_DIM                  1024
IMAGE_META_SIZE                23
IMAGE_MIN_DIM                  800
IMAGE_MIN_SCALE                0
IMAGE_RESIZE_MODE              square
IMAGE_SHAPE                    [1024 1024    3]
LEARNING_MOMENTUM              0.9
LEARNING_RATE                  0.001
LOSS_WEIGHTS                   {'rpn_class_loss': 1.0, 'rpn_bbox_loss': 1.0, 'mrcnn_class_loss': 1.0, 'mrcnn_bbox_loss': 1.0, 'mrcnn_mask_loss': 1.0}
MASK_POOL_SIZE                 14
MASK_SHAPE                     [28, 28]
MASK_SHARE                     False
MAX_GT_INSTANCES               100
MEAN_PIXEL                     [123.7 116.8 103.9]
MINI_MASK_SHAPE                (512, 512)
NAME                           taco
NUM_CLASSES                    11
OPTIMIZER                      SGD
POOL_SIZE                      7
POST_NMS_ROIS_INFERENCE        1000
POST_NMS_ROIS_TRAINING         2000
ROI_POSITIVE_RATIO             0.33
RPN_ANCHOR_RATIOS              [0.5, 1, 2]
RPN_ANCHOR_SCALES              (32, 64, 128, 256, 512)
RPN_ANCHOR_STRIDE              1
RPN_BBOX_STD_DEV               [0.1 0.1 0.2 0.2]
RPN_NMS_THRESHOLD              0.7
RPN_TRAIN_ANCHORS_PER_IMAGE    256
STEPS_PER_EPOCH                600
TRAIN_BN                       False
TRAIN_ROIS_PER_IMAGE           200
USE_MINI_MASK                  True
USE_OBJECT_ZOOM                True
USE_RPN_ROIS                   True
VALIDATION_STEPS               50
WEIGHT_DECAY                   0.0001
ZOOM_IN_FREQ                   0.5


Traceback (most recent call last):
  File "/Users/hackeron/TACO/detector/detector.py", line 272, in <module>
    model = MaskRCNN(mode="training", config=config, model_dir=DEFAULT_LOGS_DIR)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hackeron/TACO/detector/model.py", line 1921, in __init__
    self.keras_model = self.build(mode=mode, config=config)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hackeron/TACO/detector/model.py", line 1961, in build
    gt_boxes = KL.Lambda(lambda x: norm_boxes_graph(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/keras/src/utils/traceback_utils.py", line 70, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/opt/homebrew/lib/python3.11/site-packages/tensorflow/python/framework/type_spec.py", line 962, in type_spec_from_value
    raise TypeError(f"Could not build a TypeSpec for {value} of "
TypeError: Could not build a TypeSpec for KerasTensor(type_spec=TensorSpec(shape=(None, None, 4), dtype=tf.float32, name=None), name='tf.math.truediv/truediv:0', description="created by layer 'tf.math.truediv'") of unsupported type <class 'keras.src.engine.keras_tensor.KerasTensor'>.

I'm using tensorflow 2.13.0rc0

Any ideas?

Download dataset on windows

I'm trying to download the dataset from my laptop. I've dowloaded this project and extracted it. Then, I go on to the path and type "cmd" do open the cmd.exe from the directory (just like the picture below).
image
I start typing "python3 download.py" to start download the dataset just like the instruction. Then the result is shown as the picture below.
image
Did I do something wrong?

help

Hi Pedropro,

You have an interesting project, in early stage, can we help you get to your 10k images?

Requesting info about the annotation tool

Hi!

First of all thanks a lot for this very nice project! I find the annotation tool you provide quite nice! I was wondering if you are able to share it, or provide some information if one wanted to implement a similar one (or the same on a different dataset :D ). I'm guessing that tool automatically saves the annotation json file for each image so it can be further trained? I'm actually trying to implement a public annotation tool like the one you have, so if you can provide any detail it would be very much appreciated!

I've noticed in the source material of the website that the annotation js script was written by you, awesome! Do you have it in some public repository, or thinking on doing that anytime soon? Sorry if I've missed it somewhere!

Thanks!

Contributing

Hi,

First of all, thank you for the great work in collecting and annotating these images.
Second of all, there is a lot of unofficial images, is there any way we can contribute to evaluating those images (a lot of them have teachers noise, however, a lot of them are quite usable)?
This dataset could be quite useful, however, in its current form, it is diverse enough to be genuinely useful for some real world problems.

Discrepancy with the naming in the Taxonomy page and the annotations.json file

Hi thank you so much for your project! It is very helpful for what I am working on right now! The issuse is a minor typo but has made me lose a lot of time trying to find out the source of the problem.

I am using a COCO to YOLO annotation converter, and when I wrote down the category names I used the names used on the Taxonomy website, where all the second words are always lowercase. However, on the annotations.json file the "Food can" category is actually written as "Food Can", meaning I kept getting a Type error when trying to find that category. I know this is minor but please do change it as it took some real digging into the annotations file and a hawk eye to discover this!

COCO Format Annotations

Hi, many thanks for sharing your greate work, i was wondering wether can you share the annotations in coco format like .json format. That would be great help.

Annotate the 3111 others images

Hi @pedropro
Fantastic project,
I would like to be able to collaborate with the annotation of the other 3000 images, but the online annotation system present on the site is a little slow, I think that I can do it faster using semantic segmentation and then use edge filter algorithms to do instantiation segmentation or use your own trained model to write down something similar to semi-supervised learning. for that, I implemented a requisition system that asks the server of your site for a new image and I get the request return and save that image, but as the return is always a random image I don't get the 3111 images, if you could make it available right here on git the images not yet stained I could collaborate with the annotation
I have been working with garbage detection since last year, but due to lack of time I was unable to make a dataset as good as what was done for you, congratulations for the excellent work

Update to Requirements section in ReadMe.md

In the Readme.md for this project, it calls for pip3 install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI and I wasn't able to get it to work with just that command.

I continuously got this error:

pip3 install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
Collecting git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI
  Cloning https://github.com/philferriere/cocoapi.git to c:\users\c m\appdata\local\temp\pip-req-build-y7ldg9q5
  Running command git clone -q https://github.com/philferriere/cocoapi.git 'C:\Users\C M\AppData\Local\Temp\pip-req-build-y7ldg9q5'
Using legacy 'setup.py install' for pycocotools, since package 'wheel' is not installed.
Installing collected packages: pycocotools
                                                      Running setup.py install for pycocotools ... error
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\c m\pycharmprojects\taco\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\C M\\AppData\\Local\\Temp\\pip-req-build-y7ldg9q5\\PythonAPI\\setup.py'"'"'; __f
ile__='"'"'C:\\Users\\C M\\AppData\\Local\\Temp\\pip-req-build-y7ldg9q5\\PythonAPI\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(
code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\C M\AppData\Local\Temp\pip-record-o7lt68yh\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\c m\pycharmprojects\taco\ve
nv\include\site\python3.8\pycocotools'
         cwd: C:\Users\C M\AppData\Local\Temp\pip-req-build-y7ldg9q5\PythonAPI
    Complete output (13 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.8
    creating build\lib.win-amd64-3.8\pycocotools
    copying pycocotools\coco.py -> build\lib.win-amd64-3.8\pycocotools
    copying pycocotools\cocoeval.py -> build\lib.win-amd64-3.8\pycocotools
    copying pycocotools\mask.py -> build\lib.win-amd64-3.8\pycocotools
    copying pycocotools\__init__.py -> build\lib.win-amd64-3.8\pycocotools
    running build_ext
    building 'pycocotools._mask' extension
    error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\c m\pycharmprojects\taco\venv\scripts\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\C M\\AppData\\Local\\Temp\\pip-req-build-y7ldg9
q5\\PythonAPI\\setup.py'"'"'; __file__='"'"'C:\\Users\\C M\\AppData\\Local\\Temp\\pip-req-build-y7ldg9q5\\PythonAPI\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"
'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\C M\AppData\Local\Temp\pip-record-o7lt68yh\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\
users\c m\pycharmprojects\taco\venv\include\site\python3.8\pycocotools' Check the logs for full command output.

At first I followed the suggestion and went to https://visualstudio.microsoft.com/visual-cpp-build-tools/, but installing that continued to show the same error.

I stumbled on this How to install c++ build tools in a conda virtual environment for use with cython/setproctitle, and the suggestion of installing Microsoft Visual C++ 14.0 worked and I was able to get the CocoAPI to install.

display

visualize.py
in function display_instances():
I think you should add plt.close(),because detecting video,this maybe cause a memory leak

Training Hangs on First Epoch

I'm running your code on Windows rn, and the repo is taking forever to progress past the first epoch in training after executing the standard command listed in the detector.py file. I am using PyTorch 1.8.0+cpu and torchvision 0.9.0+cpu. Any advice would be appreciated. Thank you!

WARNING:tensorflow:From C:\Users\[REDACTED]\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\framework\op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
WARNING:tensorflow:From C:\Users\[REDACTED]\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\backend\tensorflow_backend.py:1154: calling reduce_max_v1 (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
WARNING:tensorflow:From C:\Users\[REDACTED]\AppData\Local\Programs\Python\Python37\lib\site-packages\keras\backend\tensorflow_backend.py:1188: calling reduce_sum_v1 (from tensorflow.python.ops.math_ops) with keep_dims is deprecated and will be removed in a future version.
Instructions for updating:
keep_dims is deprecated, use keepdims instead
...
Selecting layers to train
conv1 (Conv2D)
...
mrcnn_mask (TimeDistributed)
WARNING:tensorflow:From C:\Users\[REDACTED]\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\ops\math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
2022-04-30 20:47:14.305094: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
Epoch 1/100

Trained Model Weights for Transfer Learning

Greatly appreciate this project and the amount of work that has gone into it from the developers and the community! My university team and I are undertaking a project to research automated waste detection mechanisms, and this project is perfectly aligned with the objectives of our investigation.
Would it be possible to also share the trained weights for the MASK R-CNN model, such that these can be used as part of a transfer learning strategy? Thanks!

Does anyone have a trained model I could use?

Hi, this is a great dataset. I will definitely train some data for the project. I was wondering if anyone had a docker container or a tenserflow model file I could use. It would definitely save me time. Thanks!

Hosting TACO on Roboflow Universe

Hello there! We're big fans of the TACO project at Roboflow. I noticed that you are hosting your images on Flickr. Roboflow would be happy to host the TACO dataset on Universe, a repository of more than 200,000 image datasets, to accompany your Flickr download.

Our dataset download would only take a minute or so depending on your internet connection. Users would require a free Roboflow account to download the dataset, then they can use our Python SDK (https://docs.roboflow.com/api-reference/install-python-package) to download the dataset.

Annotations not showing up

Hi, thank you for the dataset! I tried following the instructions given but the output of the demo.ipynb file is the image with the bounding box without any annotations on the detected objects. Please can you suggest how to get the annotations to show up along with the bounding box?
Thank you

Screenshot (328)
Screenshot (327)

annotions - bbox coordinate order

from the code I think bbox list is ordered as (ymin, xmin, ymax, xmax)
Is this correct?

it would be nicer to have that explicitly spelled out in the annotations.json

OSError: cannot write mode RGBA as JPEG

I'm trying to download the unofficial training set and getting this:

$ python3 download.py --dataset_path ./data/annotations_unofficial.json
Note. If for any reason the connection is broken. Just call me again and I will start where I left.
Traceback (most recent call last):......] - 26/3831
  File "/opt/homebrew/lib/python3.11/site-packages/PIL/JpegImagePlugin.py", line 640, in _save
    rawmode = RAWMODE[im.mode]
              ~~~~~~~^^^^^^^^^
KeyError: 'RGBA'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/hackeron/Garbage-Detection/faster-rcnn/TACO/download.py", line 49, in <module>
    img.save(file_path)
  File "/opt/homebrew/lib/python3.11/site-packages/PIL/Image.py", line 2432, in save
    save_handler(self, fp, filename)
  File "/opt/homebrew/lib/python3.11/site-packages/PIL/JpegImagePlugin.py", line 643, in _save
    raise OSError(msg) from e
OSError: cannot write mode RGBA as JPEG

As a temporary workaround I edited JpegImagePlugin.py to ignore RGBA images:

def _save(im, fp, filename):
    if im.width == 0 or im.height == 0:
        msg = "cannot write empty image as JPEG"
        raise ValueError(msg)

    try:
        if im.mode == 'RGBA':
            return
        rawmode = RAWMODE[im.mode]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.