Skip to content

Commit

Permalink
fix path double slash and os dir
Browse files Browse the repository at this point in the history
  • Loading branch information
KeplerC committed Apr 24, 2024
1 parent 5a34a3c commit c6c0f98
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# 🦊 Fog-X
# 🦊 Fog-RT-X

[![codecov](https://codecov.io/gh/KeplerC/fog_x/branch/main/graph/badge.svg?token=fog_x_token_here)](https://codecov.io/gh/KeplerC/fog_x)
[![CI](https://github.com/KeplerC/fog_x/actions/workflows/main.yml/badge.svg)](https://github.com/KeplerC/fog_x/actions/workflows/main.yml)

🦊 Fog-X: An Efficient and Scalable Data Collection and Management Framework For Robotics Learning. Support [Open-X-Embodiment](https://robotics-transformer-x.github.io/), 🤗[HuggingFace](https://huggingface.co/).
🦊 Fog-RT-X: An Efficient and Scalable Data Collection and Management Framework For Robotics Learning. Support [Open-X-Embodiment](https://robotics-transformer-x.github.io/), 🤗[HuggingFace](https://huggingface.co/).

🦊 Fog-X considers both speed 🚀 and memory efficiency 📈 with active metadata and lazily-loaded trajectory data. It supports flexible and distributed dataset partitioning.
🦊 Fog-RT-X considers both speed 🚀 and memory efficiency 📈 with active metadata and lazily-loaded trajectory data. It supports flexible and distributed dataset partitioning.

## Install

Expand Down
2 changes: 1 addition & 1 deletion fog_x/database/polars_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def load_tables(self, table_names: List[str]):

# load tables from the path
for table_name in table_names:
path = self.path.strip("/")
path = self.path.removesuffix("/")
path = f"{path}/{table_name}.parquet"
logger.info(f"Prepare to load table {table_name} loaded from {path}.")

Expand Down
9 changes: 7 additions & 2 deletions fog_x/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ def __init__(
* is replace_existing actually used anywhere?
"""
self.name = name
path = os.path.expanduser(path).strip("/")
path = os.path.expanduser(path).removesuffix("/")
logger.info(f"Dataset path: {path}")
self.path = path
if path is None:
raise ValueError("Path is required")
Expand All @@ -112,7 +113,7 @@ def __init__(
self.features = features
self.enable_feature_inference = enable_feature_inference
if episode_info_connector is None:
episode_info_connector = DataFrameConnector(f"{path}/")
episode_info_connector = DataFrameConnector(f"{path}")

if step_data_connector is None:
if not os.path.exists(f"{path}/{name}"):
Expand Down Expand Up @@ -437,6 +438,10 @@ def _prepare_rtx_metadata(
feature_name = r["feature"]
if "image" in feature_name and "depth" not in feature_name:
image = np.load(io.BytesIO(r["value"]))

# convert from RGB to BGR
image = cv2.cvtColor(image, cv2.COLOR_RGB2BGR)

if feature_name not in video_writers:

output_filename = f"{self.name}_{counter}_{feature_name}"
Expand Down
5 changes: 4 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ torch
tensorflow
tensorflow_datasets
envlogger
opencv-python
opencv-python
# cloud
boto3
smart_open

0 comments on commit c6c0f98

Please sign in to comment.