Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Naive scale to nanna #1091

Merged
merged 60 commits into from
Oct 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
3bd9b1e
first changes toward light update
winthos Aug 31, 2022
388e2e4
Merge remote-tracking branch 'origin/nanna' into naive-scale-light
winthos Aug 31, 2022
b379c06
more changes to light manager
winthos Aug 31, 2022
841b0e1
editor light naming tools updated
winthos Sep 2, 2022
922b114
Improving GUID object name appending editor script
winthos Sep 2, 2022
b28c220
Merge remote-tracking branch 'origin/nanna' into naive-scale-light
winthos Sep 2, 2022
9fdca65
rename all sim objects with new GUID
winthos Sep 2, 2022
3e74966
progress toward light serialization
winthos Sep 2, 2022
a10d78d
Merge branch 'naive-scale' into naive-scale-light
winthos Sep 9, 2022
1769877
Merge branch 'nanna' into naive-scale
winthos Sep 9, 2022
fc8abcf
Merge branch 'naive-scale' into naive-scale-light
winthos Sep 9, 2022
a0be6cb
serialize out light culling mask to string array
winthos Sep 10, 2022
b8479b1
further changes to light manager and serialization
winthos Sep 13, 2022
48c81a1
add CreateSkybox
mattdeitke Sep 13, 2022
f9e4ba4
newScene to debug input
mattdeitke Sep 13, 2022
d0fd558
Merge branch 'naive-scale' of https://github.com/allenai/ai2thor into…
mattdeitke Sep 13, 2022
ff75436
Toggle light changes
winthos Sep 13, 2022
62a8f03
Create NormalsVisualizer.cs.meta
winthos Sep 14, 2022
d9be5d4
rename all lights in prebuilt scenes
winthos Sep 14, 2022
8a590bc
adjusting light references in kitchens
winthos Sep 16, 2022
dc3c072
fix to isToggled flag
winthos Sep 16, 2022
7c4d406
buggy scale update
mattdeitke Sep 16, 2022
9d4cb43
obj action
mattdeitke Sep 16, 2022
bfe4f28
Merge branch 'naive-scale' of https://github.com/allenai/ai2thor into…
mattdeitke Sep 16, 2022
e4b26d4
move scale to before position
mattdeitke Sep 16, 2022
e5fcff4
update light toggle prefabs
winthos Sep 16, 2022
7f3fe47
update light references in living rooms
winthos Sep 16, 2022
561b1a3
fix light references in bedrooms
winthos Sep 16, 2022
705a195
fix effect references to bathroom faucets
winthos Sep 16, 2022
39734e8
first set of bathroom light updates
winthos Sep 20, 2022
16c3737
fix objects in floor
mattdeitke Sep 20, 2022
5a41a38
more fixes to bathroom scenes
winthos Sep 21, 2022
3367d31
remaining bathrooms setup
winthos Sep 21, 2022
2183611
robothor light manager updates
winthos Sep 21, 2022
d61c7af
Merge branch 'naive-scale' into naive-scale-light
winthos Sep 22, 2022
0ce19a9
rebuild
mattdeitke Sep 22, 2022
2636973
prefab and architecTHOR house updates
winthos Sep 23, 2022
bf83ecb
merge nanna-release-api into naive-scale
mattdeitke Sep 23, 2022
f320415
Merge branch 'nanna' into naive-scale
mattdeitke Sep 23, 2022
c1e887e
update types
mattdeitke Sep 23, 2022
7a88562
version -> metadata.schema so that new house compatibility isn't broken
mattdeitke Sep 23, 2022
f371cdf
Added lighting settings to FloorPlan_test-dev2_2
elimvb Sep 23, 2022
8c47b0b
Removed realtime global illumination from FloorPlan_test-dev2_2
elimvb Sep 23, 2022
e17c01f
architecTHOR light manager asset updates
winthos Sep 23, 2022
54cc5ca
cleanup renaming guids and light instances
winthos Sep 23, 2022
979e7d2
skip test
mattdeitke Sep 26, 2022
ec55f42
Update test_unity_procedural.py
mattdeitke Sep 26, 2022
188dd4b
fix to collider references
winthos Sep 26, 2022
d960516
Merge branch 'naive-scale' into naive-scale-light
winthos Sep 26, 2022
57af7fc
fixing tests
winthos Sep 27, 2022
7c5976d
Update floorplan28-fixed-obj-poses.json
winthos Sep 27, 2022
f01960c
make tv and stand kinematic
mattdeitke Sep 28, 2022
a4b749a
uhhhh
winthos Sep 28, 2022
47845d1
Merge branch 'naive-scale' into naive-scale-light
winthos Sep 28, 2022
51871f8
Removed reference to missing script
AlvaroHG Sep 28, 2022
281b26a
Merge pull request #1085 from allenai/naive-scale-light
winthos Sep 28, 2022
c9833a5
merge nanna-release-api to naive-scale
mattdeitke Sep 29, 2022
64520fc
bug fix
mattdeitke Sep 29, 2022
50f40ca
pass schema in metadata
mattdeitke Sep 29, 2022
95df853
Merge branch 'naive-scale' into nanna
AlvaroHG Oct 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,4 +308,3 @@ AI2 is a non-profit institute with the mission to contribute to humanity through
<a href="//prior.allenai.org">
<p align="center"><img width="100%" src="https://raw.githubusercontent.com/allenai/ai2thor/main/doc/static/ai2-prior.svg" /></p>
</a>

2 changes: 1 addition & 1 deletion ai2thor/tests/data/floorplan28-fixed-obj-poses.json

Large diffs are not rendered by default.

136 changes: 65 additions & 71 deletions ai2thor/tests/test_unity_procedural.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# import pytest
import json
import os
import pytest

import cv2
import numpy as np
from ai2thor.wsgi_server import WsgiServer
import pytest

from ai2thor.fifo_server import FifoServer
from .test_unity import build_controller, images_near, depth_images_near
import cv2
import json
from ai2thor.wsgi_server import WsgiServer

from .test_unity import build_controller, depth_images_near, images_near

DATA_PATH = "ai2thor/tests/data/"
IMAGE_FOLDER_PATH = os.path.join(DATA_PATH, "procedural")
Expand All @@ -19,7 +22,7 @@
width=300,
height=300,
fieldOfView=45,
agentCount=1
agentCount=1,
)

_wsgi_controller = dict(server_class=WsgiServer, **shared_args)
Expand All @@ -29,12 +32,14 @@
wsgi = [_wsgi_controller]
fifo = [_fifo_controller]


def create_pixel_diff_image(img, g_truth):
dx = np.where(~np.all(g_truth == img, axis=-1))
copy = img.copy()
copy[dx] = (255, 0, 255)
return copy


house_template = {
"id": "house_0",
"layout": """
Expand All @@ -60,104 +65,92 @@ def create_pixel_diff_image(img, g_truth):
"wallTemplate": {
"material": {
"unlit": False,
"color": {
"r": 1.0,
"g": 0.0,
"b": 0.0,
"a": 1.0
}
"color": {"r": 1.0, "g": 0.0, "b": 0.0, "a": 1.0},
}
},
"floorTemplate": {
"roomType": "Bedroom",
"floorMaterial": { "name": "DarkWoodFloors" },
"floorMaterial": {"name": "DarkWoodFloors"},
},
"floorYPosition": 0.0,
"wallHeight": 3.0
"wallHeight": 3.0,
},
"2": {
"wallTemplate": {
"material": {
"unlit": False,
"color": {
"r": 0.0,
"g": 0.0,
"b": 1.0,
"a": 1.0
}
"color": {"r": 0.0, "g": 0.0, "b": 1.0, "a": 1.0},
}
},
"floorTemplate": {
"roomType": "LivingRoom",
"floorMaterial": { "name": "RedBrick"}
"floorMaterial": {"name": "RedBrick"},
},
"floorYPosition": 0.0,
"wallHeight": 3.0
}
},
"holes": {
"=": {
"room0": "1",
"openness": 1.0,
"assetId": "Doorway_1"
}
},
"objects": {
"+": {
"kinematic": True,
"assetId": "Chair_007_1"
}
"wallHeight": 3.0,
},
},
"holes": {"=": {"room0": "1", "openness": 1.0, "assetId": "Doorway_1"}},
"objects": {"+": {"kinematic": True, "assetId": "Chair_007_1"}},
"proceduralParameters": {
"floorColliderThickness": 1.0,
"receptacleHeight": 0.7,
"skyboxId": "Sky1",
"ceilingMaterial": { "name": "ps_mat" }
"ceilingMaterial": {"name": "ps_mat"},
},
"schema": "1.0.0"
"metadata": {"schema": "1.0.0"},
}

# TODO rendering is different for fifo and wsgi server
@pytest.mark.parametrize("controller_args", fifo)
def test_render_lit(controller_args):
print("Args")
print(controller_args)
controller = build_controller(
**controller_args
)
controller = build_controller(**controller_args)

rgb_filename = "proc_rgb_lit_fifo.png"
ground_truth = cv2.imread(os.path.join(IMAGE_FOLDER_PATH, rgb_filename))

evt = controller.step(
action="GetHouseFromTemplate",
template=house_template
)
evt = controller.step(action="GetHouseFromTemplate", template=house_template)

print("Action success {0}, message {1}".format(evt.metadata["lastActionSuccess"], evt.metadata["errorMessage"]))
print(
"Action success {0}, message {1}".format(
evt.metadata["lastActionSuccess"], evt.metadata["errorMessage"]
)
)
assert evt.metadata["lastActionSuccess"], evt.metadata["errorMessage"]
house = evt.metadata["actionReturn"]

with open("test_render_lit.json", "w") as f:
print(house)
json.dump(house, f)

evt = controller.step(
action="CreateHouse",
house=house
)
evt = controller.step(action="CreateHouse", house=house)

print("Action success {0}, message {1}".format(evt.metadata["lastActionSuccess"], evt.metadata["errorMessage"]))
assert evt.metadata['lastActionSuccess']
print(
"Action success {0}, message {1}".format(
evt.metadata["lastActionSuccess"], evt.metadata["errorMessage"]
)
)
assert evt.metadata["lastActionSuccess"]

evt = controller.step(
action="TeleportFull", x=3.0, y=0.9010001, z=1.0, rotation=dict(x=0, y=0, z=0),
horizon=0, standing=True, forceAction=True
action="TeleportFull",
x=3.0,
y=0.9010001,
z=1.0,
rotation=dict(x=0, y=0, z=0),
horizon=0,
standing=True,
forceAction=True,
)

controller.stop()

assert images_near(evt.cv2img, ground_truth, max_mean_pixel_diff=52, debug_save=True)
assert images_near(
evt.cv2img, ground_truth, max_mean_pixel_diff=52, debug_save=True
)


#
# @pytest.mark.parametrize("controller_args", wsgi)
Expand All @@ -179,39 +172,40 @@ def test_render_lit(controller_args):
# assert depth_images_near(server_image, raw_depth, epsilon=2e-1, debug_save=True)



@pytest.mark.parametrize("controller_args", fifo)
def test_depth(controller_args):
controller_args.update(
renderDepthImage=True,
)

controller = build_controller(
**controller_args
)
controller = build_controller(**controller_args)

depth_filename = "proc_depth.npy"
raw_depth = np.load(os.path.join(IMAGE_FOLDER_PATH, depth_filename))

evt = controller.step(
action="GetHouseFromTemplate",
template=house_template
)
evt = controller.step(action="GetHouseFromTemplate", template=house_template)

assert evt.metadata["lastActionSuccess"], evt.metadata["errorMessage"]
house = evt.metadata["actionReturn"]

evt = controller.step(
action="CreateHouse",
house=house
)
evt = controller.step(action="CreateHouse", house=house)

print("Action success {0}, message {1}".format(evt.metadata["lastActionSuccess"], evt.metadata["errorMessage"]))
assert evt.metadata['lastActionSuccess']
print(
"Action success {0}, message {1}".format(
evt.metadata["lastActionSuccess"], evt.metadata["errorMessage"]
)
)
assert evt.metadata["lastActionSuccess"]

evt = controller.step(
action="TeleportFull", x=3.0, y=0.9010001, z=1.0, rotation=dict(x=0, y=0, z=0),
horizon=0, standing=True, forceAction=True
action="TeleportFull",
x=3.0,
y=0.9010001,
z=1.0,
rotation=dict(x=0, y=0, z=0),
horizon=0,
standing=True,
forceAction=True,
)

controller.stop()
Expand Down
2 changes: 1 addition & 1 deletion unity/Assets/Editor/ExpRoomEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class ExpRoomEditor : EditorWindow {
[MenuItem("ExpRoom/Add all pickupable receptacle prefabs to AvailableContainers", true)]
[MenuItem("ExpRoom/Interactively add all pickupable prefabs to AvailableObjects", true)]
static bool HideMenuIfNotInExpRoom() {
Debug.Log(UnityEngine.SceneManagement.SceneManager.GetActiveScene().name);
//Debug.Log(UnityEngine.SceneManagement.SceneManager.GetActiveScene().name);
return UnityEngine.SceneManagement.SceneManager.GetActiveScene().name == "FloorPlan_ExpRoom";
}

Expand Down
11 changes: 11 additions & 0 deletions unity/Assets/Editor/NormalsVisualizer.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading