pytorch-i3d icon indicating copy to clipboard operation
pytorch-i3d copied to clipboard

how to make .json?

Open LiuChangLCC opened this issue 5 years ago • 11 comments

I want to use this code to train my own dataset, but I don't know how to make the file named '(my dataset).json'! can you give some advise? thx

LiuChangLCC avatar Apr 18 '19 02:04 LiuChangLCC

same question!!!

SJYbetter avatar Jul 23 '19 23:07 SJYbetter

I solve this problem by making the (mydataset).json file, first understand the dataset.py, imitate the .json file format of author, and then write your own .json file.

LiuChangLCC avatar Jul 24 '19 07:07 LiuChangLCC

I solve this problem by making the (mydataset).json file, first understand the dataset.py, imitate the .json file format of author, and then write your own .json file.

You are so niubi

yyl-bot avatar Jul 24 '19 12:07 yyl-bot

I solve this problem by making the (mydataset).json file, first understand the dataset.py, imitate the .json file format of author, and then write your own .json file.

Hello, thx for your reply and I am so curious about how to imitate the .json file format like the author. And my another question is this repo doesn't provide the code for transfer video to image even though the function name is video_to_tensor. Do you use the ffmpeg to transfer the video to bunch of images? Do you know how to name the image file like id-000000y.jpg? I am stuck for this for a long time~~~

SJYbetter avatar Jul 24 '19 13:07 SJYbetter

Json file is generally created by serializing your class object. For example you can see below code.


import json

class MyData(object):
    
def __init__(self, actions, duration, subset):
    self.actions = actions
    self.duration = duration
    self.subset = subset
    
data1 = MyData([15.1,10,55],23.5, 'test')

with open("test.json", 'a') as f:
    json.dump(data1.__dict__,f) 

priteshgohil avatar Sep 08 '19 21:09 priteshgohil

Json file is generally created by serializing your class object. For example you can see below code.


import json

class MyData(object):
    
def __init__(self, actions, duration, subset):
    self.actions = actions
    self.duration = duration
    self.subset = subset
    
data1 = MyData([15.1,10,55],23.5, 'test')

with open("test.json", 'a') as f:
    json.dump(data1.__dict__,f) 

Hi! I want to know what are the "actions", “duration”, “subset” mean in .json file. And I want to konw if the first string at the head of {} ,e.g. "7UPGT": {"subset": "training", "duration": 23.21, "actions": [[149, 16.0, 22.2], [152, 16.0, 22.2], [142, 15.0, 20.0], [107, 14.0, 23.0], [143, 0.0, 5.0], [110, 13.9, 19.7], [61, 14.2, 24.0], [63, 5.0, 11.2]]}, “7UPGT” here, is the file name of video? THX!

River-mao avatar May 09 '20 09:05 River-mao

Json file is generally created by serializing your class object. For example you can see below code.


import json

class MyData(object):
    
def __init__(self, actions, duration, subset):
    self.actions = actions
    self.duration = duration
    self.subset = subset
    
data1 = MyData([15.1,10,55],23.5, 'test')

with open("test.json", 'a') as f:
    json.dump(data1.__dict__,f) 

Hi! I want to know what are the "actions", “duration”, “subset” mean in .json file. And I want to konw if the first string at the head of {} ,e.g. "7UPGT": {"subset": "training", "duration": 23.21, "actions": [[149, 16.0, 22.2], [152, 16.0, 22.2], [142, 15.0, 20.0], [107, 14.0, 23.0], [143, 0.0, 5.0], [110, 13.9, 19.7], [61, 14.2, 24.0], [63, 5.0, 11.2]]}, “7UPGT” here, is the file name of video? THX!

It's video id. "duration" means the length of this video, the 3 numbers in "actions" mean [action number, start time, end time], "subset" means whether it is in training set or testing set. Hope that help~

chenyr0021 avatar Jun 18 '20 07:06 chenyr0021

I solve this problem by making the (mydataset).json file, first understand the dataset.py, imitate the .json file format of author, and then write your own .json file.

where can I find the .json file in the project?

Jackson12826 avatar Nov 13 '20 04:11 Jackson12826

我通过制作(mydataset).json文件解决了这个问题,首先了解了dataset.py,模仿了author的.json文件格式,然后编写了自己的.json文件。

I want to use this code to train my own dataset, but I don't know how to make the file named '(my dataset).json'! can you give some advise? thx

想问一下您是怎么制作json文件的呢?

zzzzyq-18 avatar Dec 17 '20 13:12 zzzzyq-18

I solve this problem by making the (mydataset).json file, first understand the dataset.py, imitate the .json file format of author, and then write your own .json file.

Hello, thx for your reply and I am so curious about how to imitate the .json file format like the author. And my another question is this repo doesn't provide the code for transfer video to image even though the function name is video_to_tensor. Do you use the ffmpeg to transfer the video to bunch of images? Do you know how to name the image file like id-000000y.jpg? I am stuck for this for a long time~~~

I also have this problem. do you solve it? can you tell me how to do with this?

liujinhu217 avatar Mar 30 '21 02:03 liujinhu217

I solve this problem by making the (mydataset).json file, first understand the dataset.py, imitate the .json file format of author, and then write your own .json file.

Hello, thx for your reply and I am so curious about how to imitate the .json file format like the author. And my another question is this repo doesn't provide the code for transfer video to image even though the function name is video_to_tensor. Do you use the ffmpeg to transfer the video to bunch of images? Do you know how to name the image file like id-000000y.jpg? I am stuck for this for a long time~~~

I also have this problem. do you solve it? can you tell me how to do with this?

hi, you can see the history issue ,I find author have share it ......................

jun0wanan avatar Jul 02 '21 07:07 jun0wanan