Comments (11)
Hi! Sorry for the late reply. It's crazy times. I will need to generate higher res masks for HOF, but it is definitely possible.
from hand-segmentation-in-the-wild.
Would this be done using xml annotations? If so I already made them and I could send them if you like.
from hand-segmentation-in-the-wild.
from hand-segmentation-in-the-wild.
Hi,
Are the high-res masks already online? I could not find them.
from hand-segmentation-in-the-wild.
out.zip
here, manually clean iirc
from hand-segmentation-in-the-wild.
@test1230-lab Thank you very much!
from hand-segmentation-in-the-wild.
from hand-segmentation-in-the-wild.
@test1230-lab
So the images you sent me are created using the polygon data from the XML right? I noticed two things:
- There are two hand masks missing (298 files in 'out.zip' vs 300 in 'images_orig_size').
- The indices in 'out.zip' do not lign up with the indices in 'imgages_orig_size'.
While these are both minor inconveniences (I can fix issue 2 manually without too much effort), I was wondering what the root of these two issues is? Do you have the script that created 'out.zip' available? Would you be willing to share it?
And I guess you don't have a "manually cleaned" version of the images?
from hand-segmentation-in-the-wild.
i think this is the one.
`import xmltodict
import glob
import os
from PIL import Image
from PIL import Image, ImageDraw
import argparse
from tqdm import tqdm
parser = argparse.ArgumentParser(description='simple parser')
parser.add_argument('--input_folder', type=str, default="./xml/",
help='path to only xml files', required=False)
parser.add_argument('--output_folder', type=str, default="output/", help='path to store the images ', required=False)
args = parser.parse_args()
def draw(image, pt_dict):
pt_arr = []
for p in pt_dict:
pt_arr.append((int(p["x"]),int(p["y"])))
image_draw = ImageDraw.Draw(image)
image_draw.polygon(pt_arr, fill="#FFFFFF", outline ="white")
del image_draw
return image
def run_prog(in_folder, out_folder):
#print(in_folder, out_folder)
my_files = sorted(glob.glob(os.path.join(in_folder, "*.xml")))
#print(my_files)
for f in tqdm(my_files):
try:
if f.split(".")[-1].lower() not in "xml":
print(f.split(".")[-1].lower())
continue
with open(f, 'r') as file:
data = file.read().replace('\n', '')
my_dict = xmltodict.parse(data)
#print(data)
#print(data)
#print(my_dict)
fname=my_dict['annotation']["filename"]
fname_no = int(fname.replace(".jpg", ""))
img_size_w = int(my_dict['annotation']["imagesize"]["nrows"])
img_size_h = int(my_dict['annotation']["imagesize"]["ncols"])
my_object = my_dict['annotation']['object']
image = Image.new('RGB', (img_size_h, img_size_w))
if isinstance(my_object, dict):
poly_pt_dict=my_object['polygon']
pt_dict = poly_pt_dict['pt']
image = draw(image, pt_dict)
elif isinstance(my_object, list):
#print(type(my_object))
for el in my_object:
#print(el)
poly_pt_dict = el['polygon']
pt_dict = poly_pt_dict['pt']
image = draw(image, pt_dict)
# pass
#poly_pt_dict = my_object[-1]
#continue
#print(my_object)
#poly_pt_dict=my_object['polygon']
#print(poly_pt_dict)
#print(pt_dict)
#display(image)
xx = (os.path.join(out_folder, f"{str(fname_no)}.jpg"))
xx = xx[23:]
#print(xx)
test = './output2/' + xx
xx = './images_original_size/' + xx
print('xx',xx)
#print(test)
#break
#print(xx,test)
#print('xx',xx)
#img = Image.open(xx)
#img.save(test)
os.rename(xx,test)
image.save(os.path.join(out_folder, f"{str(fname_no)}.png"))
#del image_draw
del image
del my_dict
except:
continue
if __name__ == "__main__":
run_prog(args.input_folder, args.output_folder)
`
from hand-segmentation-in-the-wild.
Awesome, thx!
from hand-segmentation-in-the-wild.
Thanks @test1230-lab! closing this issue now.
from hand-segmentation-in-the-wild.
Related Issues (12)
- Demo code? HOT 3
- Error in HandOverFace(HOF) dataset HOT 2
- How to train on my own datasets? HOT 2
- EYTH Dataset masks saved as jpg in vid6 HOT 2
- Could not download the datasets HOT 2
- training details HOT 3
- The URL list of original movies used in EgoYoutubeHand dataset HOT 5
- Generalising to bigger images
- Transparent Hands Dataset HOT 3
- Would you please specify your dataset license? HOT 1
- Assertion Failed Error while running demo_refinenet_test_example_egohands.m script
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hand-segmentation-in-the-wild.