Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*__pycache__
*__pycache__
*.ipynb
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "GLIP"]
path = GLIP
url = https://github.com/Junital/GLIP.git
1 change: 1 addition & 0 deletions GLIP
Submodule GLIP added at c43038
Binary file added assets/COCO_train2014_000000022882.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/COCO_train2014_000000269022.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/COCO_train2014_000000576849.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages.zip
Binary file not shown.
Binary file added data/ExperImages/n103484.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n109961.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n111074.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n115871.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n130253.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n130371.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n133975.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n139491.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n147001.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n149859.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n154501.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n155297.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n15719.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n158542.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n170047.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n171693.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n173361.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n175869.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n178815.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n181615.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n182120.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n184739.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added data/ExperImages/n188669.jpg
Binary file added data/ExperImages/n189986.jpg
Binary file added data/ExperImages/n194711.jpg
Binary file added data/ExperImages/n196089.jpg
Binary file added data/ExperImages/n20290.jpg
Binary file added data/ExperImages/n210059.jpg
Binary file added data/ExperImages/n210277.jpg
Binary file added data/ExperImages/n214414.jpg
Binary file added data/ExperImages/n215517.jpg
Binary file added data/ExperImages/n229656.jpg
Binary file added data/ExperImages/n239383.jpg
Binary file added data/ExperImages/n24913.jpg
Binary file added data/ExperImages/n253231.jpg
Binary file added data/ExperImages/n258003.jpg
Binary file added data/ExperImages/n261100.jpg
Binary file added data/ExperImages/n264509.jpg
Binary file added data/ExperImages/n266971.jpg
Binary file added data/ExperImages/n267826.jpg
Binary file added data/ExperImages/n274318.jpg
Binary file added data/ExperImages/n275523.jpg
Binary file added data/ExperImages/n287162.jpg
Binary file added data/ExperImages/n298165.jpg
Binary file added data/ExperImages/n299577.jpg
Binary file added data/ExperImages/n307753.jpg
Binary file added data/ExperImages/n311711.jpg
Binary file added data/ExperImages/n312992.jpg
Binary file added data/ExperImages/n318563.jpg
Binary file added data/ExperImages/n324512.jpg
Binary file added data/ExperImages/n339300.jpg
Binary file added data/ExperImages/n339728.jpg
Binary file added data/ExperImages/n341278.jpg
Binary file added data/ExperImages/n343034.jpg
Binary file added data/ExperImages/n345315.jpg
Binary file added data/ExperImages/n345363.jpg
Binary file added data/ExperImages/n349224.jpg
Binary file added data/ExperImages/n366949.jpg
Binary file added data/ExperImages/n383044.jpg
Binary file added data/ExperImages/n394813.jpg
Binary file added data/ExperImages/n406179.jpg
Binary file added data/ExperImages/n408516.jpg
Binary file added data/ExperImages/n409008.jpg
Binary file added data/ExperImages/n41686.jpg
Binary file added data/ExperImages/n424704.jpg
Binary file added data/ExperImages/n437038.jpg
Binary file added data/ExperImages/n464936.jpg
Binary file added data/ExperImages/n466504.jpg
Binary file added data/ExperImages/n468138.jpg
Binary file added data/ExperImages/n474949.jpg
Binary file added data/ExperImages/n475122.jpg
Binary file added data/ExperImages/n479684.jpg
Binary file added data/ExperImages/n487547.jpg
Binary file added data/ExperImages/n488098.jpg
Binary file added data/ExperImages/n49911.jpg
Binary file added data/ExperImages/n511793.jpg
Binary file added data/ExperImages/n51303.jpg
Binary file added data/ExperImages/n513747.jpg
Binary file added data/ExperImages/n514077.jpg
Binary file added data/ExperImages/n515157.jpg
Binary file added data/ExperImages/n524673.jpg
Binary file added data/ExperImages/n525013.jpg
Binary file added data/ExperImages/n536090.jpg
Binary file added data/ExperImages/n537813.jpg
Binary file added data/ExperImages/n544799.jpg
Binary file added data/ExperImages/n550668.jpg
Binary file added data/ExperImages/n553018.jpg
Binary file added data/ExperImages/n554025.jpg
Binary file added data/ExperImages/n557683.jpg
Binary file added data/ExperImages/n560895.jpg
Binary file added data/ExperImages/n56556.jpg
Binary file added data/ExperImages/n565573.jpg
Binary file added data/ExperImages/n568258.jpg
Binary file added data/ExperImages/n59657.jpg
Binary file added data/ExperImages/n59853.jpg
Binary file added data/ExperImages/n60178.jpg
Binary file added data/ExperImages/n61019.jpg
Binary file added data/ExperImages/n66626.jpg
Binary file added data/ExperImages/n93063.jpg
Binary file added data/problem.xlsx
Binary file not shown.
101 changes: 101 additions & 0 deletions data/test.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
isBalanced,question,imageId
True,Which kind of furniture is below the decoration?,n274318
True,Which kind of clothing is warm?,n115871
True,Which kind of clothing is not black?,n184739
True,Do the pants that are not dirty look large?,n66626
True,The lamp that is not turned-off is sitting on top of what?,n210059
True,What kind of furniture is made of metal?,n188669
True,Is the shirt orange or blue?,n554025
True,Do you see either any white towels or pillows?,n468138
True,Is the closed drawer to the right of a chair?,n15719
True,What is the lamp made of?,n133975
True,What does the man wear?,n51303
True,What is under the cooking utensil made of wood?,n349224
True,Are the end table and the desk made of the same material?,n194711
True,Is the counter above a drawer?,n229656
True,Are the pants black and long?,n149859
True,What is the cup to the left of the keyboard made of?,n475122
True,Is the standing woman behind the tomatoes wearing a hat?,n299577
True,Where is the man in front of the fence standing on?,n464936
True,What appliance is not used?,n409008
True,Do you see any women inside the library?,n93063
True,How large is the device the computer monitor is beside of?,n479684
True,The bun is on what?,n24913
True,What is the boy doing?,n49911
True,Is there a bed or a desk in this picture?,n170047
True,Does the gate look metallic and tall?,n196089
True,Does the mirror look clean and brown?,n266971
True,What is in front of the street light?,n511793
True,Is the helmet on the right?,n339728
True,Are there white desks in the picture?,n345363
True,Is the house both white and small?,n109961
True,Is the bag behind a chair?,n214414
True,Is the garbage can to the left of the people?,n147001
True,Are the benches in front of the person hard and red?,n324512
True,Is there a train above the street that is made of brick?,n253231
True,The tomatoes are in what?,n557683
True,Is the plate on a counter?,n318563
True,Are there any women in the photo that are not riding?,n59657
True,What is the piece of furniture that is hanging above the wall called?,n61019
True,Is the plastic bucket to the right or to the left of the toilet that is white?,n171693
True,What is the man wearing?,n275523
True,Is there a blue window in this picture?,n189986
True,Does the dress look short sleeved?,n515157
True,How large is the pitcher that the ketchup is in front of?,n158542
True,What is in front of the trees?,n139491
True,Does the person that is not old wear a hat?,n560895
True,Is the happy person on the left or on the right side of the image?,n383044
True,Is the empty bottle on the right side or on the left?,n60178
True,Which kind of clothing is light colored?,n111074
True,Do you see tables in the photo?,n154501
True,What animal is standing on the small boat?,n178815
True,What is the plate near the candle holder sitting atop?,n264509
True,Which place is it?,n424704
True,What is the device in front of the person that is sitting on the ground called?,n20290
True,Do you see end tables next to the sofa on the left part of the photo?,n307753
True,What is under the windows?,n341278
True,Does that sweatshirt have striped pattern and gray color?,n345315
True,What is the color of the toilet paper?,n287162
True,What's the man doing?,n513747
True,Which device is on?,n59853
True,Are there black sandals or boots?,n41686
True,Is the plastic cup to the left of the other cup small and colorful?,n215517
True,What kind of furniture are the drawers in?,n133975
True,Are the men to the left of a bowl?,n298165
True,What animal is brown?,n406179
True,What is the color of the wine glasses?,n544799
True,Are there both cars and fences in the photo?,n130253
True,Are there either any plates or breads in the image?,n267826
True,What is on the motorcycle?,n339300
True,How large are the rocks?,n408516
True,Which kind of food is bigger than the blueberry?,n466504
True,What is the woman wearing?,n537813
True,What does the man wear?,n366949
True,"Which side of the picture are the bags on, the left or the right?",n568258
True,Where is the snowboarder standing on?,n553018
True,How is this vehicle called?,n487547
True,Who is holding onto the umbrella?,n103484
True,What is the toilet brush next to the toilet made of?,n514077
True,Who in this image is talking?,n343034
True,What type of fast food is the woman that is not old looking at?,n394813
True,Are the daughter that is not old and the daughter to the right of the dad both happy?,n155297
True,Are the people that are talking leaning on the wood fence?,n181615
True,Is the clock both round and gold?,n239383
True,Is the girl to the left of the backpack waiting or playing?,n437038
True,Is the table gray?,n56556
True,What is the color of the bread that is not little?,n312992
True,What is in front of the trees?,n536090
True,Is that street sign black and small?,n311711
True,Is that fork made of stainless steel?,n474949
True,What is the weather like in the picture?,n130371
True,Is there a mug on top of the bench?,n261100
True,Is the sand both black and wet?,n175869
True,What is the aircraft that the woman is looking at?,n524673
True,What pieces of furniture are to the left of the car?,n173361
True,Who in this photograph is looking down?,n488098
True,Is the sink short or tall?,n182120
True,What is that fence in front of?,n258003
True,Are there any chairs near the decorative painting?,n210277
True,How clean is the headband that the girl is wearing?,n525013
True,Is the small building behind or in front of the bushy tree?,n550668
True,Does the umbrella look female and white?,n565573
Binary file added data/visualization.xlsx
Binary file not shown.
10 changes: 10 additions & 0 deletions download_GLIP.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# change this to your preferred download location
PRETRAINED_MODELS_PATH=./pretrained_models

# GLIP model
mkdir -p $PRETRAINED_MODELS_PATH/GLIP/checkpoints
mkdir -p $PRETRAINED_MODELS_PATH/GLIP/configs
wget -nc -P $PRETRAINED_MODELS_PATH/GLIP/checkpoints https://huggingface.co/GLIPModel/GLIP/resolve/main/glip_large_model.pth
wget -nc -P $PRETRAINED_MODELS_PATH/GLIP/configs https://raw.githubusercontent.com/microsoft/GLIP/main/configs/pretrain/glip_Swin_L.yaml
39 changes: 39 additions & 0 deletions engine/object_graph.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
class ObjectGraph:

def __init__(self, Name: str, Box,
Category : str = "object",
Location : tuple = (0, 0),
Size : tuple = (0, 0)) -> None:

self.Attribute = dict(
Name = Name,
Box = Box,
Category = Category,
Location = Location,
Size = Size
)

def add(self, key: str, value: any) -> None:

self.Attribute[key] = value

class ObjectGraphGroup:

def __init__(self, img=None, groupA=None, groupB=None):
if img is not None:
self.Graphs = []
self.Relations = dict()
self.Img = img
elif groupA is not None and groupB is not None:
self.Graphs = groupA.Graphs + groupB.Graphs
self.Relations = groupA.Relations | groupB.Relations
self.Img = groupA.Img
else:
raise ValueError("You must give a image or give two groups.")

def add_graph(self, graph: ObjectGraph):

self.Graphs.append(graph)

def add_relation(self, objA, objB, relation):
self.Relations[(objA, objB)] = relation
Loading