File size: 6,929 Bytes
d7ff85b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
[
    {
     "function_name": "forward",
     "file_path": "Textual_Encoder",
     "function_calls": [
      {
       "function_call_name": "tokenize",
       "functionality": "Converts a list of text prompts into a tokenized format that CLIP's text encoder can process.",
       "input": "p",
       "output": "Tokenized prompts",
       "location_or_namespace": "clip"
      },
      {
       "function_call_name": "cat",
       "functionality": "Concatenates the tokenized prompts into a single tensor.",
       "input": "a sequence of tensors",
       "output": "A single concatenated tensor",
       "location_or_namespace": "torch"
      },
      {
       "function_call_name": "cuda",
       "functionality": "Moves the tensor to the GPU.",
       "input": "",
       "output": "The tensor on the GPU",
       "location_or_namespace": "torch"
      },
      {
       "function_call_name": "encode_text",
       "functionality": "Encodes the tokenized text into a feature vector using the CLIP text encoder.",
       "input": "tokenized text prompts",
       "output": "textual features",
       "location_or_namespace": "clip"
      },
      {
       "function_call_name": "repeat",
       "functionality": "Duplicates the text features for each of the NUM_VIEWS.",
       "input": "dimensions to repeat along",
       "output": "The repeated tensor",
       "location_or_namespace": "torch.Tensor"
      }
     ]
    },
    {
     "function_name": "load_clip_to_cpu",
     "file_path": "canonical_code.py",
     "function_calls": [
      {
       "function_call_name": "_download",
       "functionality": "Downloads the CLIP model from the specified URL.",
       "input": "URL of the CLIP model",
       "output": "Path to the downloaded model",
       "location_or_namespace": "clip"
      },
      {
       "function_call_name": "load",
       "functionality": "Loads a JIT compiled PyTorch model from a file.",
       "input": "model_path, map_location='cpu'",
       "output": "The loaded JIT model",
       "location_or_namespace": "torch.jit"
      },
      {
       "function_call_name": "load",
       "functionality": "Loads a PyTorch state dictionary from a file.",
       "input": "model_path, map_location='cpu'",
       "output": "The loaded state dictionary",
       "location_or_namespace": "torch"
      },
      {
       "function_call_name": "state_dict",
       "functionality": "Returns the state dictionary of a PyTorch module.",
       "input": "",
       "output": "The model's state dictionary",
       "location_or_namespace": "torch.nn.Module"
      },
      {
       "function_call_name": "build_model",
       "functionality": "Constructs a CLIP model from a state dictionary.",
       "input": "A state dictionary",
       "output": "The built CLIP model",
       "location_or_namespace": "clip"
      }
     ]
    },
    {
     "function_name": "build_model",
     "file_path": "PointCLIPV2_ZS",
     "function_calls": [
      {
       "function_call_name": "load_clip_to_cpu",
       "functionality": "Loads a pre-trained CLIP model onto the CPU.",
       "input": "cfg",
       "output": "A CLIP model instance",
       "location_or_namespace": "canonical_code.py"
      },
      {
       "function_call_name": "cuda",
       "functionality": "Moves the CLIP model to the GPU.",
       "input": "",
       "output": "The CLIP model on the GPU",
       "location_or_namespace": "torch.nn.Module"
      },
      {
       "function_call_name": "Textual_Encoder",
       "functionality": "Initializes the Textual_Encoder class to process text prompts.",
       "input": "cfg, classnames, clip_model",
       "output": "An instance of the Textual_Encoder class",
       "location_or_namespace": "canonical_code.py"
      },
      {
       "function_call_name": "Realistic_Projection",
       "functionality": "Initializes the Realistic_Projection class, which handles the 3D to 2D projection.",
       "input": "",
       "output": "An instance of the Realistic_Projection class",
       "location_or_namespace": "trainers/mv_utils_zs"
      },
      {
       "function_call_name": "Tensor",
       "functionality": "Creates a PyTorch tensor from a list of view weights.",
       "input": "A list of view weights",
       "output": "A PyTorch tensor",
       "location_or_namespace": "torch"
      }
     ]
    },
    {
     "function_name": "real_proj",
     "file_path": "PointCLIPV2_ZS",
     "function_calls": [
      {
       "function_call_name": "get_img",
       "functionality": "Performs the 3D to 2D projection steps.",
       "input": "pc (point cloud)",
       "output": "A 2D image (depth map)",
       "location_or_namespace": "trainers/mv_utils_zs"
      },
      {
       "function_call_name": "cuda",
       "functionality": "Moves the image tensor to the GPU.",
       "input": "",
       "output": "The image tensor on the GPU",
       "location_or_namespace": "torch"
      },
      {
       "function_call_name": "interpolate",
       "functionality": "Upsamples the projected image to the required size (224x224).",
       "input": "img, size=(imsize, imsize), mode='bilinear', align_corners=True",
       "output": "The interpolated image tensor",
       "location_or_namespace": "torch.nn.functional"
      }
     ]
    },
    {
     "function_name": "model_inference",
     "file_path": "PointCLIPV2_ZS",
     "function_calls": [
      {
       "function_call_name": "real_proj",
       "functionality": "Converts the 3D point cloud into multi-view 2D depth maps.",
       "input": "pc (point cloud)",
       "output": "A batch of images",
       "location_or_namespace": "canonical_code.py"
      },
      {
       "function_call_name": "type",
       "functionality": "Casts the tensor to the correct data type (inherited from the CLIP model).",
       "input": "self.dtype",
       "output": "The tensor with the new data type",
       "location_or_namespace": "torch.Tensor"
      },
      {
       "function_call_name": "reshape",
       "functionality": "Reshapes the tensor to a new size.",
       "input": "The desired new dimensions",
       "output": "The reshaped tensor",
       "location_or_namespace": "torch.Tensor"
      },
      {
       "function_call_name": "append",
       "functionality": "Adds an item to the end of a list.",
       "input": "item to append",
       "output": "None",
       "location_or_namespace": "list"
      },
      {
       "function_call_name": "t",
       "functionality": "Transposes the tensor.",
       "input": "",
       "output": "The transposed tensor",
       "location_or_namespace": "torch.Tensor"
      },
      {
       "function_call_name": "norm",
       "functionality": "Calculates the L2 norm of the tensor along a specified dimension.",
       "input": "The dimension to calculate the norm on",
       "output": "The L2 norm",
       "location_or_namespace": "torch.Tensor"
      }
     ]
    }
   ]