Skip to content

Commit

Permalink
Set boundary flags for contact surface tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
ranlu committed Apr 30, 2024
1 parent 8122030 commit d590234
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/cut_chunk_cs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def chunk_origin(bbox):
offset[i] -= 1
return offset

def write_metadata(fn, offset, size, ac_offset, low, high):
def write_metadata(fn, offset, size, ac_offset, low, high, boundaries):
with open(fn, "w") as f:
f.write(" ".join([str(x) for x in offset]))
f.write("\n")
Expand All @@ -19,6 +19,8 @@ def write_metadata(fn, offset, size, ac_offset, low, high):
f.write(str(ac_offset))
f.write("\n")
f.write(" ".join([str(low), str(high)]))
f.write("\n")
f.write(" ".join([str(x) for x in boundaries]))

param = read_inputs(sys.argv[1])
global_param = read_inputs(os.environ['PARAM_JSON'])
Expand All @@ -44,4 +46,4 @@ def write_metadata(fn, offset, size, ac_offset, low, high):
low_th = float(global_param.get('CS_LOW_THRESHOLD', 0.0))


write_metadata("param.txt", chunk_origin(bbox), seg_cutout.shape[0:3], offset, low_th, high_th)
write_metadata("param.txt", chunk_origin(bbox), seg_cutout.shape[0:3], offset, low_th, high_th, boundary_flags)

0 comments on commit d590234

Please sign in to comment.