Skip to content

Commit

Permalink
Merge pull request #1 from vballoli/main
Browse files Browse the repository at this point in the history
Merge code to main repo
  • Loading branch information
vballoli authored Nov 5, 2023
2 parents dc526fb + 307613d commit 82a3ffa
Show file tree
Hide file tree
Showing 196 changed files with 22,370 additions and 25 deletions.
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# Project
# Chanakya: Learning Runtime Decisions for Adaptive Real-Time Perception

> This repo has been populated by an initial template to help get you started. Please
> make sure to update the content to build a great experience for community-building.
This repository contains code for our paper "Chanakya: Learning Runtime Decisions for Adaptive Real-Time Perception" appearing in NeurIPS'23.

As the maintainer of this project, please make a few updates:
## Setup

- Improving this README.MD file to provide a great experience
- Updating SUPPORT.MD with content about this project's support experience
- Understanding the security reporting process in SECURITY.MD
- Remove this section from the README
1. `conda env create -f environment.yml`

## Contributing

Expand Down
18 changes: 1 addition & 17 deletions SUPPORT.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
# TODO: The maintainer of this repo has not yet edited this file

**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?

- **No CSS support:** Fill out this template with information about how to file issues and get help.
- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps.
- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide.

*Then remove this first heading from this SUPPORT.MD file before publishing your repo.*

# Support

## How to file issues and get help

This project uses GitHub Issues to track bugs and feature requests. Please search the existing
issues before filing new issues to avoid duplicates. For new issues, file your bug or
feature request as a new Issue.

For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
CHANNEL. WHERE WILL YOU HELP PEOPLE?**.
Please reach out to Anurag Ghosh or [Vaibhav Balloli](mailto:[email protected]) in case of queries. This project is not actively maintained.

## Microsoft Support Policy

Expand Down
48 changes: 48 additions & 0 deletions diversity/compute_class_mAP.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import matplotlib.pyplot as plt
from pycocotools.coco import COCO
from pycocotools.cocoeval import COCOeval
import numpy as np
import json
import os
import glob
import pickle
import sys
import cv2
from PIL import Image
import mmcv
import time
import pickle

models_name = ['yolo', 'fcos', 'faster_rcnn', 'faster_rcnn_101', 'cascade_rcnn']
type_data = sys.argv[1]

annType = 'bbox'
dataDir='../datasets/coco'
dataType= type_data + '2017'

annFile='{}/annotations/instances_{}.json'.format(dataDir,dataType)
cocoGt=COCO(annFile)
YOUR_CAT_IDS = sorted(cocoGt.getCatIds())

out_file = "/mnt/IoU_results_coco/" + 'per_class_mAP_' + type_data + '.pkl'
final_result_dict = {}

for model_name in models_name:
print("Here is the model name: ",model_name)
resFile = "/mnt/IoU_results_coco/"+ model_name + "/" + type_data + "/" + type_data + ".json"
cocoDt=cocoGt.loadRes(resFile)
coco_eval = COCOeval(cocoGt, cocoDt, annType)
final_result_dict[model_name] = []
stats = []
for i in range(len(YOUR_CAT_IDS)):
coco_eval.params.catIds = YOUR_CAT_IDS[i]
coco_eval.evaluate()
coco_eval.accumulate()
coco_eval.summarize()
stats.append(coco_eval.stats[1])

final_result_dict[model_name] = stats

print(final_result_dict)
with open(out_file, 'wb') as handle:
pickle.dump(final_result_dict, handle, protocol=pickle.HIGHEST_PROTOCOL)
19 changes: 19 additions & 0 deletions diversity/compute_cosine.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pickle
from scipy import spatial
import sys

type_data = sys.argv[1]
models_name = ['yolo', 'fcos', 'faster_rcnn', 'faster_rcnn_101', 'cascade_rcnn']
input_file_path = "/mnt/IoU_results_coco/" + 'per_class_mAP_' + type_data + '.pkl'

with open(input_file_path, 'rb') as handle:
final_result_dict = pickle.load(handle)

result_dict = {}
for model_name_1 in models_name:
for model_name_2 in models_name:
diff_string = model_name_1 + '_' +model_name_2
# result_dict[diff_string] = spatial.distance.cosine(normalize(final_result_dict[model_name_1], norm="l1"), normalize(final_result_dict[model_name_2], norm = "l1"))
result_dict[diff_string] = spatial.distance.cosine(final_result_dict[model_name_1], final_result_dict[model_name_2])

print(result_dict)
125 changes: 125 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: hams-chanakya
channels:
- defaults
dependencies:
- _libgcc_mutex=0.1=main
- ca-certificates=2020.12.8=h06a4308_0
- certifi=2020.12.5=py37h06a4308_0
- ld_impl_linux-64=2.33.1=h53a641e_7
- libedit=3.1.20191231=h14c3975_1
- libffi=3.3=he6710b0_2
- libgcc-ng=9.1.0=hdf63c60_0
- libstdcxx-ng=9.1.0=hdf63c60_0
- ncurses=6.2=he6710b0_1
- openssl=1.1.1i=h27cfd23_0
- pip=20.3.1=py37h06a4308_0
- python=3.7.9=h7579374_0
- readline=8.0=h7b6447c_0
- setuptools=51.0.0=py37h06a4308_2
- sqlite=3.33.0=h62c20be_0
- tk=8.6.10=hbc83047_0
- wheel=0.36.1=pyhd3eb1b0_0
- xz=5.2.5=h7b6447c_0
- zlib=1.2.11=h7b6447c_3
- pip:
- absl-py==0.10.0
- apache-beam==2.25.0
- astunparse==1.6.3
- attrs==20.3.0
- avro-python3==1.9.2.1
- cachetools==4.1.1
- cffi==1.14.4
- chardet==3.0.4
- contextlib2==0.6.0.post1
- crcmod==1.7
- cycler==0.10.0
- cython==0.29.21
- dataclasses==0.6
- dill==0.3.1.1
- dm-tree==0.1.5
- docopt==0.6.2
- fastavro==1.2.1
- future==0.18.2
- gast==0.3.3
- gin-config==0.4.0
- google-api-core==1.23.0
- google-api-python-client==1.12.8
- google-auth==1.23.0
- google-auth-httplib2==0.0.4
- google-auth-oauthlib==0.4.2
- google-cloud-bigquery==2.6.1
- google-cloud-core==1.4.4
- google-crc32c==1.0.0
- google-pasta==0.2.0
- google-resumable-media==1.1.0
- googleapis-common-protos==1.52.0
- grpcio==1.34.0
- h5py==2.10.0
- hdfs==2.5.8
- httplib2==0.17.4
- idna==2.10
- importlib-metadata==3.1.1
- importlib-resources==3.3.0
- kaggle==1.5.10
- keras-preprocessing==1.1.2
- kiwisolver==1.3.1
- lvis==0.5.3
- lxml==4.6.2
- markdown==3.3.3
- matplotlib==3.3.3
- mock==2.0.0
- numpy==1.18.5
- oauth2client==4.1.3
- oauthlib==3.1.0
- object-detection==0.1
- opencv-contrib-python==4.4.0.46
- opencv-python==4.4.0.46
- opencv-python-headless==4.4.0.46
- opt-einsum==3.3.0
- pandas==1.1.5
- pbr==5.5.1
- pillow==8.0.1
- promise==2.3
- proto-plus==1.13.0
- protobuf==3.14.0
- psutil==5.7.3
- py-cpuinfo==7.0.0
- pyarrow==0.17.1
- pyasn1==0.4.8
- pyasn1-modules==0.2.8
- pycparser==2.20
- pydot==1.4.1
- pymongo==3.11.2
- pyparsing==2.4.7
- python-dateutil==2.8.1
- python-slugify==4.0.1
- pytz==2020.4
- pyyaml==5.3.1
- requests==2.25.0
- requests-oauthlib==1.3.0
- rsa==4.6
- scipy==1.5.4
- sentencepiece==0.1.94
- six==1.15.0
- tensorboard==2.4.0
- tensorboard-plugin-wit==1.7.0
- tensorflow==2.3.1
- tensorflow-addons==0.11.2
- tensorflow-datasets==4.1.0
- tensorflow-estimator==2.3.0
- tensorflow-hub==0.10.0
- tensorflow-metadata==0.25.0
- tensorflow-model-optimization==0.5.0
- termcolor==1.1.0
- text-unidecode==1.3
- tf-models-official==2.3.0
- tf-slim==1.1.0
- tqdm==4.54.1
- typeguard==2.10.0
- typing-extensions==3.7.4.3
- uritemplate==3.0.1
- urllib3==1.26.2
- werkzeug==1.0.1
- wrapt==1.12.1
- zipp==3.4.0
prefix: /home/hamsadmin/anaconda3/envs/hams-chanakya
1 change: 1 addition & 0 deletions sap_eval/chanakya
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
../scale/
5 changes: 5 additions & 0 deletions sap_eval/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"image_service_port": 5007,
"result_service_port": 5008,
"loopback_ip": "127.0.0.1"
}
Loading

0 comments on commit 82a3ffa

Please sign in to comment.