YaTharThShaRma999 commited on
Commit
7f40c21
1 Parent(s): d15226d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +12 -42
README.md CHANGED
@@ -1,43 +1,13 @@
1
- import numpy as np
2
- import heapq
3
 
4
- def heuristic(a, b):
5
- return np.sqrt((b[0] - a[0]) ** 2 + (b[1] - a[1]) ** 2)
6
-
7
- def astar(array, start, goal):
8
- neighbors = [(0, 1), (0, -1), (1, 0), (-1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
9
- close_set = set()
10
- came_from = {}
11
- gscore = {start: 0}
12
- fscore = {start: heuristic(start, goal)}
13
- open_heap = [(fscore[start], start)]
14
- array_shape = array.shape
15
- array_get = array.__getitem__
16
-
17
- while open_heap:
18
- current_fscore, current = heapq.heappop(open_heap)
19
-
20
- if current == goal:
21
- path = []
22
- while current in came_from:
23
- path.append(current)
24
- current = came_from[current]
25
- return path[::-1]
26
-
27
- close_set.add(current)
28
- for i, j in neighbors:
29
- neighbor = current[0] + i, current[1] + j
30
-
31
- if 0 <= neighbor[0] < array_shape[0] and 0 <= neighbor[1] < array_shape[1]:
32
- if array_get(neighbor) == 1 or neighbor in close_set:
33
- continue # Skip obstacles and already visited nodes
34
-
35
- tentative_g_score = gscore[current] + heuristic(current, neighbor)
36
-
37
- if tentative_g_score < gscore.get(neighbor, float('inf')):
38
- came_from[neighbor] = current
39
- gscore[neighbor] = tentative_g_score
40
- fscore[neighbor] = tentative_g_score + heuristic(neighbor, goal)
41
- heapq.heappush(open_heap, (fscore[neighbor], neighbor))
42
-
43
- return None # No path found
 
 
 
1
 
2
+ git clone https://github.com/graspnet/graspnet-baseline.git
3
+ cd graspnet-baseline
4
+ pip install -r requirements.txt
5
+ cd pointnet2
6
+ python setup.py install
7
+ cd knn
8
+ python setup.py install
9
+ git clone https://github.com/graspnet/graspnetAPI.git
10
+ cd graspnetAPI
11
+ pip install .
12
+ CUDA_VISIBLE_DEVICES=0 python demo.py --checkpoint_path logs/log_kn/checkpoint.tar
13
+ https://drive.google.com/file/d/1hd0G8LN6tRpi4742XOTEisbTXNZ-1jmk/view?pli=1